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

Problem in Calling transactions from a program

former_member506713
Participant
0 Likes
1,276

Hi Experts,

I have a requirement to process 3 transactions F-29, VA01 and F-32 in a program 1 after another.

So i tried like this.

call TRANSACTION 'F-29'.

call TRANSACTION 'VA01'.

call TRANSACTION 'F-32'.

This is working and posting also done correctly.

But problem is whenever i am clicking back button at any screen of program it should go to initial screen, i.e, F-29 initial screen.

But in my case if i m pressing back button while i am in F-29 screen, its going to VA01 initial screen and if back button is pressed in VA01, its going to F-32 screen.

Is there any possibilities to capture 'BACK' in Sy-UCOMM?

Please Suggest

Thanks in Advance

Lucky

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,160

check this

[http://www.sapfans.com/forums/viewtopic.php?f=13&t=9971]

Just for reference SAP note 941500 addresses this issue

Edited by: Safel007 on May 20, 2009 12:51 PM

14 REPLIES 14
Read only

Former Member
0 Likes
1,160

Hi,

Please explain clearly how you want the process .

Read only

Former Member
0 Likes
1,161

check this

[http://www.sapfans.com/forums/viewtopic.php?f=13&t=9971]

Just for reference SAP note 941500 addresses this issue

Edited by: Safel007 on May 20, 2009 12:51 PM

Read only

Former Member
0 Likes
1,160

Hi,

CASE sy-ucomm

when 'BACK'

Call the transaction 'F-29'.

ENDCASE.

Hope this will help.

Regards

Manju

Read only

former_member209217
Active Contributor
0 Likes
1,160

Hi,

Try using AT SELECTION-SCREEN event .Write the coding like this

AT SELECTION-SCREEN.

Case SY_UCOMM.

when 'BACK'.

write ur coding according to ur requirement.

Regards,

Lakshman.

Read only

Former Member
0 Likes
1,160

Hi ,

Please check this code , it will resolve the issue .

CALL TRANSACTION 'F-29'.
CASE sy-ucomm.
  WHEN '  ' OR 'RW'.
    CALL TRANSACTION 'F-29'.
ENDCASE.
CALL TRANSACTION 'VA01'.
CASE sy-ucomm.
  WHEN '  ' OR 'RW'.
    CALL TRANSACTION 'F-29'.
ENDCASE.
CALL TRANSACTION 'F-32'.
CASE sy-ucomm .
  WHEN '  ' OR 'RW'.
    CALL TRANSACTION 'F-29'.
ENDCASE.

Regards

Pinaki

Read only

0 Likes
1,160

Thanks Pinaki and thanks everybody.

I tried as per your suggestion.

But after pressing back button, its coming back to Z program but sy-ucomm contains nothing. I checked it by debugging that its finding nothing in sy-ucomm and going to next transaction.

Read only

0 Likes
1,160

Thanks Pinaki and thanks everybody.

I tried as per your suggestion.

But after pressing back button, its coming back to Z program but sy-ucomm contains nothing. I checked it by debugging that its finding nothing in sy-ucomm and going to next transaction.

Read only

0 Likes
1,160

Hi,

As because SY-UCOMM is initial , in case statement WHEN ' ' is checked.

Please check once please -

CALL TRANSACTION 'F-29'.
CASE sy-ucomm.
  WHEN space.
    CALL TRANSACTION 'F-29'.
ENDCASE.
CALL TRANSACTION 'VA01'.
CASE sy-ucomm.
  WHEN space.
    CALL TRANSACTION 'F-29'.
ENDCASE.

Regards

Pinaki

Read only

Former Member
0 Likes
1,160

Hi,

You can try below code..

Case sy-ucomm.

when 'RW'.

if sy-tcode = 'F-29'.

leave screen.

endif.

if sy-tcode = 'F-32'.

call TRANSACTION 'VA01'.

endif.

when 'BAC1'.

call TRANSACTION 'F-29'.

endcase.

Hope this wil help you.

Best Regards,

Deepa Kulkarni

Read only

Vijay
Active Contributor
0 Likes
1,160

hi,

if u are calling transactions in custom report then u need to use

SET SCREEN 0

leave screen.

it will work fine.

regards

vj

Read only

Former Member
0 Likes
1,160

run the below code and check


DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA:   BDCDATA LIKE BDCDATA    OCCURS 0 WITH HEADER LINE.

call TRANSACTION 'F-29' USING BDCDATA
                     MESSAGES INTO MESSTAB.
if not messtab[] is initial.
  refresh messtab.
  call TRANSACTION 'VA01' USING BDCDATA
                     MESSAGES INTO MESSTAB.
  if not messtab[] is initial.
    refresh messtab.
    call TRANSACTION 'F-32' USING BDCDATA
                     MESSAGES INTO MESSTAB.
  endif.
endif.

Edited by: Tripat Pal Singh on May 20, 2009 3:52 PM

Read only

0 Likes
1,160

Hi All.

Back option is working fine. Thanks all for ur valuable suggestions.

can anybody tell how can i capture the values entered in the screen?

**********************************************************************

I tried using 'DYNP_VALUES_READ' FM like below.

DATA:

l_i_dynpfields TYPE STANDARD TABLE OF dynpread INITIAL SIZE 0,

l_wa_dynpfields TYPE dynpread,

l_carrid TYPE RF05A-NEWKO.

*Populate the Parameter Name whoso value is required

l_wa_dynpfields-fieldname = 'RF05A-NEWKO'. "Customer Account

APPEND l_wa_dynpfields TO l_i_dynpfields.

*Call the FM to read that value

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'SAPMF05A'

dynumb = '111'

  • TRANSLATE_TO_UPPER = ' '

  • REQUEST = ' '

  • PERFORM_CONVERSION_EXITS = ' '

  • PERFORM_INPUT_CONVERSION = ' '

  • DETERMINE_LOOP_INDEX = ' '

TABLES

dynpfields = l_i_dynpfields

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

invalid_parameter = 7

undefind_error = 8

double_conversion = 9

stepl_not_found = 10

OTHERS = 11

.

IF sy-subrc = 0.

*Get the value

READ TABLE l_i_dynpfields INTO l_wa_dynpfields

WITH KEY fieldname = 'RF05A-NEWKO'.

IF sy-subrc = 0.

l_carrid = l_wa_dynpfields-fieldvalue.

ENDIF.

ENDIF.

**************************************************

and also FM 'GET_DYNP_VALUE' as

*DATA : l_newko TYPE string.

*

*CALL FUNCTION 'GET_DYNP_VALUE'

*EXPORTING

*I_FIELD = 'RF05A-NEWKO'

*I_REPID = 'SAPMF05A'

*I_DYNNR = '111'

*CHANGING

*O_VALUE = l_newko.

****************************************************

But both are not able to collect values.

This is required so that account no of customer i can be used directly in 1st screen of transaction 'F-32'.

Thanks

Lucky

Read only

0 Likes
1,160

I don't know how to read items from screen, but of course you can get customer open items from BSIK table.

Read only

0 Likes
1,160

Got the solution finally taking directly from table BSEG considering posting document number.