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

demo for updating a transaction

hi all,

can anyone plz send me the demo for how to updata a transaction ,

not standard transaction like mm01,va01,me21 some what other transaction.why iam asking for some what other transaction when ever i was attending for interview they expecting some different transaction

plz help me ,so that i will be thankful to you.some differnt transaction with steps plzzzzzzzzzzz.

thank u all.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 06:01 AM

    Pls check the demp program demo_program_call_transaction

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 06:28 AM

    Hi,

    create a new program and copy the below code.

    Note:- create a flat file (with comma seperated) with the below structure.

    Flat file Example:-

    Material number,oldmaterial number (don't put this header in your flat file)

    13571228,oldmaterial

    13571229,oldmaterial1

    save this file into your local path, make sure that the path should be given in the function module "GUI_UPLOAD" example:- "D:\MM02.TXT".

    test this it will work.

    copy from here.

    DATA : BEGIN OF it_data OCCURS 0,

    data(255),

    END OF it_data .

    DATA : BEGIN OF it_mat OCCURS 0,

    matnr LIKE rmmg1-matnr,

    bismt LIKE mara-bismt,

    END OF it_mat.

    DATA : BEGIN OF it_error OCCURS 0,

    matnr LIKE mara-matnr,

    mess(255),

    END OF it_error.

    DATA : it_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE,

    it_bdcmsgcoll LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE,

    v_text(200).

    PERFORM upload.

    LOOP AT it_data.

    PERFORM pop_mat.

    ENDLOOP.

    LOOP AT it_mat.

    PERFORM pop_bdcdata.

    REFRESH it_bdcmsgcoll.

    CLEAR it_bdcmsgcoll.

    CALL TRANSACTION 'MM02' USING it_bdcdata

    UPDATE 'S'

    MODE 'A'

    MESSAGES INTO it_bdcmsgcoll.

    IF sy-subrc NE 0.

    LOOP AT it_bdcmsgcoll WHERE msgtyp = 'E' OR

    msgtyp = 'A' OR

    msgtyp = 'S'.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    id = it_bdcmsgcoll-msgid

    lang = sy-langu

    no = it_bdcmsgcoll-msgnr

    v1 = it_bdcmsgcoll-msgv1

    v2 = it_bdcmsgcoll-msgv2

    v3 = it_bdcmsgcoll-msgv3

    v4 = it_bdcmsgcoll-msgv4

    IMPORTING

    msg = v_text

    EXCEPTIONS

    NOT_FOUND = 1

    OTHERS = 2

    .

    IF sy-subrc NE 0.

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

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

    ENDIF.

    CONCATENATE it_error-mess v_text INTO it_error-mess.

    ENDLOOP.

    it_error-matnr = it_mat-matnr.

    APPEND it_error.

    CLEAR it_error.

    ENDIF.

    ENDLOOP.

    LOOP AT it_error.

    WRITE : it_error-matnr, it_error-mess.

    ENDLOOP.

    FORM upload .

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    filename = 'D:\sreeram\MM02.TXT'

    filetype = 'ASC'

    TABLES

    data_tab = it_data .

    IF sy-subrc NE 0.

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

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

    ENDIF.

    ENDFORM. " UPLOAD

    FORM pop_mat .

    SPLIT it_data AT ',' INTO it_mat-matnr

    it_mat-bismt.

    APPEND it_mat.

    CLEAR it_mat.

    ENDFORM. " POP_BDCDATA

    FORM pop_bdcdata .

    REFRESH it_bdcdata.

    CLEAR it_bdcdata.

    PERFORM fill_screen USING 'SAPLMGMM' '0060' 'X'.

    PERFORM fill_valus USING 'BDC_CURSOR'

    'RMMG1-MATNR'.

    PERFORM fill_valus USING 'RMMG1-MATNR'

    it_mat-matnr.

    PERFORM fill_valus USING 'BDC_OKCODE'

    '=AUSW'.

    PERFORM fill_screen USING 'SAPLMGMM' '0070' 'X'.

    PERFORM fill_valus USING 'BDC_CURSOR'

    'MSICHTAUSW-DYTXT(01)'.

    PERFORM fill_valus USING 'MSICHTAUSW-KZSEL(01)'

    'X'.

    PERFORM fill_valus USING 'BDC_OKCODE'

    '=ENTR'.

    PERFORM fill_screen USING 'SAPLMGMM' '4004' 'X'.

    PERFORM fill_valus USING 'BDC_CURSOR'

    'MARA-BISMT'.

    PERFORM fill_valus USING 'MARA-BISMT'

    it_mat-bismt.

    PERFORM fill_valus USING 'BDC_OKCODE'

    '=BU'.

    ENDFORM. " POP_BDCDATA

    FORM fill_screen USING p_prog

    p_dynpro

    p_dynbegin.

    it_bdcdata-program = p_prog.

    it_bdcdata-dynpro = p_dynpro.

    it_bdcdata-dynbegin = p_dynbegin.

    APPEND it_bdcdata.

    CLEAR it_bdcdata.

    ENDFORM. " FILL_SCREEN

    FORM fill_valus USING p_fnam

    p_fval.

    it_bdcdata-fnam = p_fnam.

    it_bdcdata-fval = p_fval.

    APPEND it_bdcdata.

    CLEAR it_bdcdata.

    ENDFORM. " FILL_VALUS

    End of copy

    Also see this :

    Here iam giving just recorded sample code.here material number is ASNFINAL.

    Old material number changed is :'OLD_BSIMT'.

    -


    perform bdc_dynpro using 'SAPLMGMM' '0060'.

    perform bdc_field using 'BDC_CURSOR'

    'RMMG1-MATNR'.

    perform bdc_field using 'BDC_OKCODE'

    '=ENTR'.

    perform bdc_field using 'RMMG1-MATNR'

    'ASNFINAL'.

    perform bdc_dynpro using 'SAPLMGMM' '0070'.

    perform bdc_field using 'BDC_CURSOR'

    'MSICHTAUSW-DYTXT(01)'.

    perform bdc_field using 'BDC_OKCODE'

    '=ENTR'.

    perform bdc_field using 'MSICHTAUSW-KZSEL(01)'

    'X'.

    perform bdc_dynpro using 'SAPLMGMM' '4004'.

    perform bdc_field using 'BDC_OKCODE'

    '=BU'.

    perform bdc_field using 'MAKT-MAKTX'

    'ASN FINAL TEST MATERIAL'.

    perform bdc_field using 'BDC_CURSOR'

    'MARA-BISMT'.

    perform bdc_field using 'MARA-MEINS'

    'EA'.

    perform bdc_field using 'MARA-MATKL'

    'AS02'.

    perform bdc_field using 'MARA-BISMT'

    'OLD_BSIMT'.

    perform bdc_field using 'MARA-SPART'

    '10'.

    perform bdc_field using 'MARA-PRDHA'

    'RC2120'.

    perform bdc_field using 'MARA-GEWEI'

    'KG'.

    Reward Points if found helpfull..

    Cheers,

    Chandra Sekhar.

    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.