Friday, 20 September 2019

Allowing multiple entries for document number in F-28 | F-32

So here I am with another blog which talks about an enhancement which can help in solving a problem that has been there in F-28, F-32 and other similar standard transactions since long time.

People worked in FI as a consultant or end users know that while using F-28, we cannot give as many document numbers as we want as input. There is a limitation on number of documents that can be supplied at one go with below flexibility:

1. Document range can be supplied(in some transactions only)
2. Once 15 document numbers are entered and pressed ‘Enter’ on keyboard, all those document numbers are captured internally and fields to provide document number is cleaned so that more document numbers can be entered.

Let’s understand in more detail with help of screenshots for TCode F-28:

i) Execute F-28 with relevant information and press Enter

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP HANA Learning, SAP HANA Study Materials

ii) Select ‘Document Number’ in pop-up

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP HANA Learning, SAP HANA Study Materials

iii) We will get below screen where we can enter Document numbers which is restricted (to 13 for F-28)

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP HANA Learning, SAP HANA Study Materials

*(Below part – point iv has appeared as part of Enhancement – showing here so that it is well connected with previous 3 steps)

iv) Do not enter any document and press ‘Process Open Items’ to get pop-up to select a desktop file having document numbers.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP HANA Learning, SAP HANA Study Materials

Using this File upload feature, users can pass any number of documents(when I say any, it is not restricted to a number in general, but users should also take care of not passing thousands of record to avoid performance issue).

Though, standard SAP transaction provides flexibilty via above 2 points, I still see it as a gap for not being able to key-in as many documents as we want.

Point-1 above fails partially when we want to choose few docments from a range and hence cannot really use the range.

Point-2 fails when users really want to enter huge number of documents and can only supply in multiples of number of allowed entries.

Below is the Source Code snippet for point-iii screen.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP HANA Learning, SAP HANA Study Materials

Technical Design

Here are the technical details of this solution via use of a Implicit Enhancement:

A) Flexibility Point-2 mentioned above works on concept that with every enter, document numbers/range is captured in an internal table and screen is made clear for more documents. So, basically this step is for collecting all the documents that user wants to clear.

B) A careful look at PAI window gives impression that MODULE SEL_WERTE takes document number and processes it temporarily for each document number enetered on screen.

C) On further exploring highlighted MODULE PAI_ANFANG,  I noticed that it can be enhanced to upload a file with Document Number and run all those entries through MODULE SEL_WERTE to have standard code/process/validations run for these entries which were added via file upload.

D) With help of an Implicit enhancement in MODULE PAI_PAI_ANFANG (which is inside MODULE PAI_ANFANG), I got all the possible document numbers via FIle Upload and mapped to FROM and TO values.

E) After mapping these values for each entry, Sub-routine PAI_SEL_WERTE was called to apply all standard validations.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP HANA Learning, SAP HANA Study Materials

This way, we were able to allow entering 100s of documents or even more in one execution and saved a lot of time for end users.

Few additional points:

1. This will work for other selection criteria also(Reference, Payment Order – as depicted in screenshot ii).

2. If needed, a screen button can be added so that Upload functionality will work only on click of that button. Otherwise, this code will be executed on press of ‘Enter’ or click of button ‘Proces Open Items’. This can be further controlled based on specific need.

3. This functionality will work for other similar transacations as well wherever MODULE PAI_ANFANG is used, so put a Screen# or TCode check if you wish to enable this only for a specific transaction

No comments:

Post a Comment