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

trigger bdc program on clicking button in oop alv

hi,

i have created one custom button in oop alv using custom container.in the ouput i have check boxes..i have to select some checkboxes and when i click on the custom button i have to trigger some bdc call transaction code for fch5 transaction.my problem is, the fields in my alv ouput and the mandatory fields in the fch5 transaction are different.how should i co-relate them.

these are the fields in opp alv ouput..

BEGIN OF ty_final,

flag(1),

status(4),

chect TYPE payr-chect,

vblnr TYPE payr-vblnr,

n_chect TYPE payr-chect,

message(200),

style TYPE lvc_t_styl,

END OF ty_final.



these are fields in bdc

perform bdc_dynpro using 'SAPMFCHK' '0500'.

perform bdc_field using 'BDC_CURSOR' 'PAYR-CHECT'.

perform bdc_field using 'BDC_OKCODE' '=UPDA'.

perform bdc_field using 'PAYR-VBLNR' lt_payr-vblnr.

perform bdc_field using 'PAYR-ZBUKR' lt_payr-zbukr.

perform bdc_field using 'PAYR-GJAHR' lt_payr-gjahr.

perform bdc_field using 'PAYR-HBKID' lt_payr-hbkid.

perform bdc_field using 'PAYR-HKTID' lt_payr-hktid.

perform bdc_field using 'PAYR-CHECT' lt_payr-chect.

perform bdc_dynpro using 'SAPMFCHK' '0501'.

perform bdc_field using 'BDC_CURSOR' 'PAYR-RWBTR'.

perform bdc_field using 'BDC_OKCODE' '=UPDA'.

perform bdc_field using 'PAYR-RWBTR' lt_payr-rwbtr.



i have to place these bdc code withinn loop end loop where flag = 'X'.(here flag is checkbox).


pls help me


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Aug 11, 2016 at 12:45 PM

    You will have to query the database first for the fields that you do not have in your alv output yet. Or read an internal table of your program if they contain these missing fields.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 11, 2016 at 12:51 PM

    You can add all the required fields for the transaction FCH5 and populate in the final internal table ty_final and update it to some custom table.

    For displaying output you can show only the fields those are required to the output.

    Once you click on the custom button it will call the BDC right...so before calling CALL TRANSACTION....you can retreive the data from the custom table and do your next actions.

    Regards

    Raj

    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.