Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

simulation in FI document

Former Member
0 Likes
1,869

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.

9 REPLIES 9
Read only

Former Member
0 Likes
1,332

It depends - how does your program work? Batch input? BAPI?

Rob

Read only

0 Likes
1,332

it works as batch input, but there is no use of SM35.

Read only

Former Member
0 Likes
1,332

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.

Read only

0 Likes
1,332

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.

Read only

0 Likes
1,332

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...

Read only

0 Likes
1,332

should we change running mode?

Read only

0 Likes
1,332

'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...

Read only

0 Likes
1,332

we ll try thanks for your kindly help.

Read only

0 Likes
1,332

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.