‎2009 Jun 10 4:27 PM
Hi ABAP gurus,
I am an FI consulatant,
we made document posting program in FI. Program gets data from excel into internal table and shows customer the field. when the customer push the post button the document is created. however there may be some tax problems so the customer wants to simulate the document.
He wants to post after simulation.
İs there any chance to process the data up to the simulatin process (before saving).
thanks in advance.
‎2009 Jun 10 4:37 PM
It depends - how does your program work? Batch input? BAPI?
Rob
‎2009 Jun 11 7:01 AM
‎2009 Jun 11 7:28 AM
In your program, in BDC code, in the end you must be using OKCODE '=BU' (post) for some screen say '0700' in this example, it might be some other screen in your code. for e.g.
....................
....................
....................
....................
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0331'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'BSEG-XREF1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BSEG-XREF1'
'IN00'.
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0700'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF05A-NEWBS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_TRANSACTION USING 'F-02'.
Now in order to SIMULATE the document before POSTING you need to enter two lines of code before the earlier Posting code.
1) the screen number that was last used before posting, in the above e.g its '0331'
2) and the OKCODE for simulate i.e. '=BS'.
so considering the eg. below make the according changes in your BDC.
....................
....................
....................
....................
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0331'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'BSEG-XREF1'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'BSEG-XREF1'
'IN00'.
*******************Code added START
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0331'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BS'.
*******************Code added END
PERFORM BDC_DYNPRO USING 'SAPMF05A' '0700'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF05A-NEWBS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BU'.
PERFORM BDC_TRANSACTION USING 'F-02'.
The above code is only for reference, make changes according to screen sequence used in your BDC.
‎2009 Jun 11 9:47 AM
thanks for your reply Tripat,
we implement what u said however it did not work,
we run batch input in "N" mode. do you have any other suggestion. we want customer to reach simulation screen before save.
‎2009 Jun 11 10:19 AM
I didn't get it.... You want the processing to stop at Simulation screen running in 'N' mode..... I don't think that is possible logically.
But i have an idea, i think it might work,
comment the code of posting i.e OKCODE '=BU' and see what happens.
By the way can you put ur code here...
‎2009 Jun 11 10:26 AM
‎2009 Jun 11 10:37 AM
'N' mode doesn't displays any screen, so even if you simulate it or not, it won't matter as the screens won't be shown at all, even if error occurs.
Then in 'E' mode only screen on which error occurs, the BDC stops for user intervention.
And in 'A' mode all the screens are shown and BDC progresses with user intervention.
Did you try commenting '=BU' part of BDC and checked? Well it might work but i am not sure...
‎2009 Jun 11 12:36 PM
‎2009 Jun 12 7:15 AM
Thx Tripat for your help,
we run in error mode, and we told the program before "save" to "give error" so the document stops before save.