Application Development 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: 

Call Transaction using BDC data

Former Member
0 Kudos

Hello All,

I have a z program in which I'm using BDC to populate values and call MR22 Transaction 2nd screen. My issue is after clicking on SAVE button on MR22 transaction, its comes back to my zprogram, which is not what i want. I need to show the first screen of MR22 transaction only. Is there a way to achieve this ?

I've already tried using these two solution, which I saw in another forum:

1) Either there is an intermediate COMMIT WORK which stops the CALL TRANSACTION (solution is then to use OPTIONS FROM <structure> and set <structure>-RACOMMIT = 'X' (request to not stop the CALL TRANSACTION if a COMMIT WORK is reached)

2) or the program detects that the transaction is called using CALL TRANSACTION and reacts differently. If the program tests SY-BINPT, then you may run the program use OPTIONS FROM <structure> and set <structure>-NOBINPT = 'X'). If the program tests other things (SY-CPROG, SY-CALLD, etc.), then the only possiblity is probably a modification of the standard!

But, it still doesn't satisfy my scenario.

Regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

After your Call Transaction you write

IF SY-SUBRC EQ 0.

CALL TRANSACTION 'TCODE'.

ENDIF.

Thanks,

Mani

12 REPLIES 12

former_member282968
Contributor
0 Kudos

Hi Roshini,

Why dont you record your BDC accordingly and run the BDC program or call the transaction after the BDC is complete?

With regards,

0 Kudos

Hello Naveen,

I've done the recording, but the user wants to see screen 2 of MR22 with the values I populated using BDC, and then they want to click the save button on MR22 screen. After that, they want to return to MR22 screen 1 and not come back to my program.

Regards.

gouravkumar64
Active Contributor
0 Kudos

Hi,

If u r tying with Leave to transaction,then use SET SCREEN 0.

try this & revert back.

Thanks

Gourav.

0 Kudos

Hello Gourav,

Its still coming back to my zprogram.

Regards.

Former Member
0 Kudos

Hi Roshni,

Please do the recording for the T_code MR22 (only those screen which u want to display) .

Recording must in the process as u want it to be displayed.

Please follow the pattern of data in the recording when it generates a technical data.

e.g code :-

FORM GET_PROGRAM_STATUS .

Data wa_objects TYPE x_objects.

DATA: bdcdata_wa  TYPE bdcdata,
       bdcdata_tab TYPE TABLE OF bdcdata.

DATA opt TYPE ctu_params.
DATA it_msg TYPE TABLE OF bdcmsgcoll.

LOOP AT i_objects INTO wa_objects.

CLEAR bdcdata_wa.
bdcdata_wa-program  = 'SAPLSLIN'.
bdcdata_wa-dynpro   = '0100'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_CURSOR'.
bdcdata_wa-fval = 'RSLIN-X_WOO'.
APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=CHEC'.
APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'RSLIN-PROGRAM'.
bdcdata_wa-fval = wa_objects-object_name.
APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.
bdcdata_wa-program  = 'SAPMSSY0'.
bdcdata_wa-dynpro   = '0120'.
bdcdata_wa-dynbegin = 'X'.
APPEND bdcdata_wa TO bdcdata_tab.

CLEAR bdcdata_wa.
bdcdata_wa-fnam = 'BDC_OKCODE'.
bdcdata_wa-fval = '=BACK'.
APPEND bdcdata_wa TO bdcdata_tab.

ENDLOOP.

CALL TRANSACTION 'SLIN' USING bdcdata_tab
                          MODE 'A'
                          UPDATE 'S'
                          MESSAGES INTO it_msg.

ENDFORM.                    " GET_PROGRAM_STATUS

Hope it will help u .....

0 Kudos

Hello Amit,

Using the above code, Its actually asking every time to press enter till i reach MR22 screen

And even after that, on clicking save, its coming back to calling program. I even tried using MODE = E.

Regards.

0 Kudos

Hi Roshni,

set NOBIEND to ''X'. ( OPTIONS FROM opt)

raymond_giuseppi
Active Contributor
0 Kudos

Keep RACOMMIT space so the SAVE or EXIT of the called transaction will get back to the caller program, but set NOBIEND to ''X'. (ref OPTIONS FROM opt)

Regards,

Raymond

0 Kudos

Still the same ...

Former Member
0 Kudos

Hi,

After your Call Transaction you write

IF SY-SUBRC EQ 0.

CALL TRANSACTION 'TCODE'.

ENDIF.

Thanks,

Mani

0 Kudos

Hello Mani,

Thanks. That did the trick.

Regards.

Former Member
0 Kudos

Hi Roshni ,

Please show the code snippets it will be better to understand from that ....