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: 

BDC with table control

Former Member
0 Kudos

Hi

My requirement is one header and several line items when i uploaded flat file(only one) by using GUI_UPLOAD it has to upload WSO1 transaction .i developed this report by using two flat files but i need to use single flat file only.

Please send me the sample program .

Thanks

Maheedhar.T

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check this link.

http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm

Regards,

Ferry Lianto

3 REPLIES 3

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check this link.

http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm

Regards,

Ferry Lianto

former_member181962
Active Contributor
0 Kudos

Former Member
0 Kudos

Maheedhar,

First upload the two files into some internal table. Then go for BDC. When going for table control in BDC always use call transaction tcode using i_bdcdata options from opt message into i_messages.

Check the below example.

data: lws_cnt type char2,

lws_field type char15.

LOOP AT i_invoicing_plan INTO wa_invoicing_plan.

lws_cnt = sy-tabix.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lws_cnt

IMPORTING

output = lws_cnt .

CONCATENATE 'FPLT-AFDAT(' lws_cnt ')' INTO lws_field.

CONCATENATE wa_invoicing_plan-date+6(2)

wa_invoicing_plan-date+4(2)

wa_invoicing_plan-date+0(4) INTO lws_date

SEPARATED BY '.'.

PERFORM bdc_field USING lws_field lws_date.

CONCATENATE 'FPLT-FPROZ(' lws_cnt ')' INTO lws_field.

lws_perct = wa_invoicing_plan-percentage.

CONDENSE lws_perct.

PERFORM bdc_field USING lws_field lws_perct.

ENDLOOP.

While calling the transaction give like this:

DATA: opt TYPE ctu_params.

opt-dismode = 'N'.

opt-updmode = 'A'.

opt-defsize = 'X'.

CALL TRANSACTION tcode

USING i_bdcdata OPTIONS FROM opt MESSAGES INTO i_messages.

LOOP AT i_messages.

ENDLOOP.

Regards,

Prakash.