08-11-2016 12:05 PM
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
08-11-2016 1: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.
08-11-2016 1: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