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: 

pass value in call transection

Former Member
0 Kudos
81

hi

In my program in alv o/p when i select one line of alv and double click on that the transection iw22 is called. there in one field i want to pass data from internal table how it is done any code please forward

3 REPLIES 3

Former Member
0 Kudos
52

Hi,

refer the below code.

PERFORM popscreen USING 'SAPMM06B' '0100'.

PERFORM popfield USING 'EBAN-BSART' fs_header-bsart.(Pass the field through fieldstring.)

PERFORM popfield USING 'EBAN-KNTTP' fs_header-knttp.

CALL TRANSACTION 'IW21' USING t_steps MODE 'A'

MESSAGES INTO t_messages.

FORM popscreen USING value(p_program)

value(p_scrno).

CLEAR t_steps.

t_steps-program = p_program.

t_steps-dynpro = p_scrno.

t_steps-dynbegin = 'x'.

APPEND t_steps.

ENDFORM.

FORM popfield USING value(p_fnam)

value(p_fval).

CLEAR t_steps.

t_steps-fnam = p_fnam.

t_steps-fval = p_fval.

APPEND t_steps.

ENDFORM. " POPFIELD

Former Member
0 Kudos
52

get the parameter id from domain of the filed which you want to call on Iw22.

use SET parameter Id coomand to apss value form internal table to field.

if paramter id is not available, Use SUBMIT statement to submit vai selection screen to call IW22.

Former Member
0 Kudos
52

Hi,

*&---------------------------------------------------------------------
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------
FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
                        I_SELFIELD TYPE SLIS_SELFIELD.

  CASE F_UCOMM.
    WHEN '&IC1'.
      READ TABLE IT_ALL INDEX I_SELFIELD-TABINDEX INTO WA_ALL.
      SET PARAMETER ID 'BES' FIELD WA_ALL-PO_NO.
      CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
  ENDCASE.
ENDFORM.                    "USER_COMMAND

This code calls transaction ME23N and passes the Purchase Order No. on selecting the specific item.

Also go through this link for a better understanding:

[https://www.sdn.sap.com/irj/scn/wiki?path=/display/home/tutorailABPSimpleALVprogramwithcellcoloring,doubleclickandusageofmacrotocreatefield+catalogue]

Regards.