Skip to Content
author's profile photo Former Member
Former Member

Call transaction to open a particular screen

hi,

please help me in this ...

i have an alv where one of the column is sales order no.

when we check a chk box placed in front of all the so number

and click a button,va02 should open and it should go directly

to the screen where the texts are listed.

skip first screen only skips first screen.

please suggest me some way to achieve the same.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 09:10 AM

    Hi

    U need to use the statamente CALL TRANSACTION in BDC mode in order to go to the particular screen:

    U can fill the BDC table ITAB in order to go to your screen and here you need to force an error, so if you use the addition MODE = E, the system'll stop the BDC at the screen you need.

    CALL TRANSACTION 'VA02' USING ITAB 
                            MODE  'E'

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 09:12 AM

    Hi,

    write like this UNDER CHECK BOX CODE.

    IF CB1 = 'X'.

    SET PARAMETERID 'AUN' FIELD VBAK-VBELN.

    CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.

    ENDIF.

    Regards

    kish

    Message was edited by:

    kishore ale

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 09:21 AM

    try following code:

    its almost same as per your requirement.

    hope it helps you.

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

    • Title : *

    • Author/Date : Prachi,Rajani 11.11.2006 *

    • Type : Report *

    • Transaction : Z_MM_BDCPO_RP *

    • Description : Creation of new purchase orders with reference PO *

    • in back ground and forground processing

    • *

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

    • M O D I F I C A T I O N L O G *

    ----


    • USER ID | DATE |CHANGE # | DESCRIPTION *

    --


    |
    |

    |
    --

    ----


    REPORT zmm_bdc_po_rp.

    TYPE-POOLS : slis.

    DATA : wa_repid LIKE sy-repid,

    UCOMM TYPE SY-UCOMM,

    RS_SELFIELD TYPE SLIS_SELFIELD.

    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.

    DATA : it_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,

    wa_fcat TYPE slis_fieldcat_alv,

    it_layout TYPE slis_layout_alv OCCURS 0 WITH HEADER LINE,

    wa_layout TYPE slis_layout_alv .

    TYPES : BEGIN OF ty_ekko, "puchase doc header data

    check(1) TYPE c,

    aedat TYPE ekko-aedat, "date created

    lifnr TYPE ekko-lifnr, "vendor no

    ekorg TYPE ekko-ekorg, "purchasing org

    ekgrp TYPE ekko-ekgrp, "purchasing group

    ebeln TYPE ekpo-ebeln, "purchase doc no

    ebelp TYPE ekpo-ebelp, "item no of purc doc

    ematn TYPE ekpo-ematn, "material no

    werks TYPE ekpo-werks, "plant

    menge TYPE ekpo-menge, "quantity

    netpr TYPE ekpo-netpr, "net price in purc doc

    END OF ty_ekko.

    DATA : it_ekko TYPE TABLE OF ty_ekko with header line.

    DATA : ebeln TYPE ekko-ebeln,

    aedat TYPE ekko-aedat,

    bsart TYPE ekko-bsart.

    ****************************SELECTION-SCREEN***********************************

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    SELECT-OPTIONS : s_ebeln FOR ebeln,

    s_aedat FOR aedat.

    PARAMETERS : p_bsart LIKE bsart DEFAULT 'NB'.

    SELECTION-SCREEN END OF BLOCK b1.

    ****************************INITIALIZATION************************************

    INITIALIZATION.

    wa_repid = sy-repid.

    PERFORM build_fieldcat.

    PERFORM build_layout.

    ***************************START-OF-SELECTION**********************************

    START-OF-SELECTION.

    SELECT a~aedat

    a~lifnr

    a~ekorg

    a~ekgrp

    b~ebeln

    b~ebelp

    b~ematn

    b~menge

    b~werks

    b~netpr

    INTO CORRESPONDING FIELDS OF TABLE it_ekko

    FROM ekko as a inner join ekpo as b

    on aebeln eq bebeln

    WHERE aebeln IN s_ebeln AND aaedat IN s_aedat.

    **************************END OF SELECTION*************************************

    PERFORM display_output.

    &----


    *& Form build_fieldcat

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM build_fieldcat .

    DATA : COL_POS TYPE I VALUE 0.

    COL_POS = COL_POS + 1.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'CHECK'.

    wa_fcat-input = 'X'.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-checkbox = 'X'.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'EBELN'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'PUR ORD NO.'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'AEDAT'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'DATE'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'LIFNR'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'VENDOR'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'EKORG'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'PUR ORGANIZATION'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'EKGRP'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'PURC GRP'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'EBELP'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'ITEM NO.'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'EMATN'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'MATERIAL NO'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'WERKS'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'PLANT'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'MENGE'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'QUANTITY'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    wa_fcat-col_pos = COL_POS.

    wa_fcat-fieldname = 'NETPR'.

    wa_fcat-checkbox = ''.

    wa_fcat-tabname = 'IT_EKKO'.

    wa_fcat-seltext_l = 'NET PRICE'.

    wa_fcat-input = ''.

    APPEND wa_fcat TO it_fcat.

    ENDFORM. " build_fieldcat

    &----


    *& Form build_layout

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM build_layout .

    wa_layout-zebra = 'X'.

    APPEND wa_layout TO it_layout.

    ENDFORM. " build_layout

    &----


    *& Form DISPLAY_OUTPUT

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM display_output .

    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

    EXPORTING

    • I_INTERFACE_CHECK = ' '

    • I_BYPASSING_BUFFER =

    • I_BUFFER_ACTIVE = ' '

    i_callback_program = wa_repid

    i_callback_pf_status_set = 'STATUS'

    i_callback_user_command = 'UCOMMAND'

    • I_STRUCTURE_NAME =

    is_layout = it_layout

    it_fieldcat = it_fcat[]

    • IT_EXCLUDING =

    • IT_SPECIAL_GROUPS =

    • IT_SORT =

    • IT_FILTER =

    • IS_SEL_HIDE =

    • I_DEFAULT = 'X'

    • I_SAVE = ' '

    • IS_VARIANT =

    • IT_EVENTS =

    • IT_EVENT_EXIT =

    • IS_PRINT =

    • IS_REPREP_ID =

    • I_SCREEN_START_COLUMN = 0

    • I_SCREEN_START_LINE = 0

    • I_SCREEN_END_COLUMN = 0

    • I_SCREEN_END_LINE = 0

    • IR_SALV_LIST_ADAPTER =

    • IT_EXCEPT_QINFO =

    • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    t_outtab = it_ekko

    EXCEPTIONS

    PROGRAM_ERROR = 1

    OTHERS = 2

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDFORM. " DISPLAY_OUTPUT

    &----


    *& Form UCOMMAND

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM ucommand USING ucomm LIKE SY-UCOMM rs_selfield TYPE slis_selfield.

    CASE ucomm.

    WHEN '&ON'.

    LOOP AT IT_EKKO .

    IF IT_EKKO-CHECK EQ 'X'.

    PERFORM RECORDING.

    ELSE.

    CONTINUE.

    ENDIF.

    ENDLOOP.

    ENDCASE.

    ENDFORM. " UCOMMAND

    &----


    *& Form STATUS

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM status USING rt_extab TYPE slis_t_extab.

    SET PF-STATUS 'ZSTATUS'." EXCLUDING RT_EXTAB.

    ENDFORM. "STATUS

    &----


    *& Form RECORDING

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM RECORDING.

    perform bdc_dynpro using 'SAPMM06E' '0100'.

    perform bdc_field using 'BDC_CURSOR'

    'it_EKKO-LIFNR'.

    perform bdc_field using 'BDC_OKCODE'

    '=RF'.

    perform bdc_field using 'RM06E-BSART'

    'NB'.

    perform bdc_field using 'RM06E-BEDAT'

    'it_ekko-aedat'.

    perform bdc_field using 'EKKO-EKORG'

    'it_ekko-ekorg'.

    perform bdc_field using 'EKKO-EKGRP'

    'it_ekko-ekgrp'.

    perform bdc_field using 'RM06E-LPEIN'

    'T'.

    perform bdc_dynpro using 'SAPMM06E' '0500'.

    perform bdc_field using 'BDC_CURSOR'

    'RM06E-REFBS'.

    perform bdc_field using 'BDC_OKCODE'

    '=ENTE'.

    perform bdc_field using 'RM06E-REFBS'

    'it_ekko-ebeln'.

    perform bdc_dynpro using 'SAPMM06E' '0122'.

    perform bdc_field using 'BDC_CURSOR'

    'EKPO-EBELP(01)'.

    perform bdc_field using 'BDC_OKCODE'

    '=REFH'.

    perform bdc_field using 'RM06E-EBELP'

    'it_ekko-ebelp'.

    perform bdc_field using 'RM06E-TCSELFLAG(01)'

    'X'.

    perform bdc_dynpro using 'SAPMM06E' '0111'.

    perform bdc_field using 'BDC_CURSOR'

    'EKET-SLFDT'.

    perform bdc_field using 'BDC_OKCODE'

    '=NEXP'.

    perform bdc_field using 'EKPO-TXZ01'

    'Sechskantschraube M10'.

    perform bdc_field using 'EKPO-LGORT'

    '0001'.

    perform bdc_field using 'EKPO-MENGE'

    'it_ekko-menge'.

    perform bdc_field using 'EKPO-SPINF'

    'C'.

    perform bdc_field using 'EKPO-NETPR'

    'it_ekko-netpr'.

    perform bdc_field using 'EKPO-PEINH'

    '1'.

    perform bdc_field using 'EKPO-BPRME'

    'PC'.

    perform bdc_field using 'EKPO-BPUMN'

    '1'.

    perform bdc_field using 'EKPO-BPUMZ'

    '1'.

    perform bdc_field using 'EKPO-PRSDR'

    'X'.

    perform bdc_field using 'RM06E-EEIND'

    '30.11.2006'.

    perform bdc_field using 'RM06E-LPEIN'

    'D'.

    perform bdc_field using 'EKPO-MAHN1'

    '10'.

    perform bdc_field using 'EKET-SLFDT'

    '28.11.2006'.

    perform bdc_field using 'EKPO-MAHN2'

    '20'.

    perform bdc_field using 'EKPO-MAHN3'

    '30'.

    perform bdc_field using 'EKPO-WEBAZ'

    '1'.

    perform bdc_field using 'EKPO-REPOS'

    'X'.

    perform bdc_field using 'EKPO-WEBRE'

    'X'.

    perform bdc_dynpro using 'SAPMM06E' '0120'.

    perform bdc_field using 'BDC_CURSOR'

    'RM06E-BSTPO(01)'.

    perform bdc_field using 'BDC_OKCODE'

    '=BU'.

    perform bdc_field using 'RM06E-EBELP'

    '10'.

    perform bdc_field using 'RM06E-TCSELFLAG(01)'

    'X'.

    CALL TRANSACTION 'ME21' USING IT_BDCDATA MODE 'A' UPDATE 'S' .

    ENDFORM. " RECORDING

    ----


    • Start new screen *

    ----


    form bdc_dynpro using program dynpro.

    clear it_bdcdata.

    it_bdcdata-program = program.

    it_bdcdata-dynpro = dynpro.

    it_bdcdata-dynbegin = 'X'.

    append it_bdcdata.

    endform.

    ----


    • Insert field *

    ----


    form bdc_field using fnam fval.

    • if fval <> nodata.

    clear it_bdcdata.

    it_bdcdata-fnam = fnam.

    it_bdcdata-fval = fval.

    append it_bdcdata.

    • endif.

    endform.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.