Application Development and Automation 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: 
Read only

Simple Doubt in BDC

Former Member
0 Likes
868

Hi friends,

I am new to BDC .I am just trying a simple code which is written already.

This is the simple code to fill the transaction VK13 first screen.

PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RV13A-KSCHL'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RV13A-KSCHL'

wa_report-kschl.

PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RV130-SELKZ(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=WEIT'.

PERFORM bdc_field USING 'RV130-SELKZ(01)'

'X'.

CALL TRANSACTION 'VK13' USING i_bdc_tbl

MODE 'A'.

FORM bdc_dynpro USING program dynpro.

CLEAR i_bdc_tbl.

wa_bdc_tbl-program = program.

wa_bdc_tbl-dynpro = dynpro.

wa_bdc_tbl-dynbegin = 'X'.

APPEND wa_bdc_tbl TO i_bdc_tbl.

ENDFORM. "BDC_DYNPRO

FORM bdc_field USING fnam fval.

CLEAR i_bdc_tbl.

MOVE fnam TO wa_bdc_tbl-fnam.

MOVE fval TO wa_bdc_tbl-fval.

APPEND wa_bdc_tbl TO i_bdc_tbl.

ENDFORM. "BDC_FIELD

When execute this code it is just showing the empty screen of transaction vk13. It is not filling the condition type field with whatever value i am passing. When go in debugg mode i am not getting the logic again and again it is going to the first screen of vk13 and asking to enter the value whwn the statement CALL TRANSACTION is getting executed. It is clear to me.

My main doubt is we are clearing the internal table i_bdc_tbl before calling the transaction once we move the value to the specific field.I am not getting what they tried to do there.Simply moving one record to internal table and again clearing it then moving a next record and clearing it again before calling the transaction.

What we are trying to do by this?Can any one explain me.

Please help me out in understanding this.

Thanks in Advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
834

"My main doubt is we are clearing the internal table i_bdc_tbl before calling the transaction once we move the value to the specific field.I am not getting what they tried to do there"...

clear itab. " This statement doesn't clear the internal table .This clears only the header. There must be some other problem with the code.

Regards,

Ravi

Hi friends,

I am new to BDC .I am just trying a simple code which is written already.

This is the simple code to fill the transaction VK13 first screen.

PERFORM bdc_dynpro USING 'SAPMV13A' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RV13A-KSCHL'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RV13A-KSCHL'

wa_report-kschl.

PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RV130-SELKZ(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=WEIT'.

PERFORM bdc_field USING 'RV130-SELKZ(01)'

'X'.

CALL TRANSACTION 'VK13' USING i_bdc_tbl

MODE 'A'.

FORM bdc_dynpro USING program dynpro.

CLEAR i_bdc_tbl.

wa_bdc_tbl-program = program.

wa_bdc_tbl-dynpro = dynpro.

wa_bdc_tbl-dynbegin = 'X'.

APPEND wa_bdc_tbl TO i_bdc_tbl.

ENDFORM. "BDC_DYNPRO

FORM bdc_field USING fnam fval.

CLEAR i_bdc_tbl.

MOVE fnam TO wa_bdc_tbl-fnam.

MOVE fval TO wa_bdc_tbl-fval.

APPEND wa_bdc_tbl TO i_bdc_tbl.

ENDFORM. "BDC_FIELD

When execute this code it is just showing the empty screen of transaction vk13. It is not filling the condition type field with whatever value i am passing. When go in debugg mode i am not getting the logic again and again it is going to the first screen of vk13 and asking to enter the value whwn the statement CALL TRANSACTION is getting executed. It is clear to me.

My main doubt is we are clearing the internal table i_bdc_tbl before calling the transaction once we move the value to the specific field.I am not getting what they tried to do there.Simply moving one record to internal table and again clearing it then moving a next record and clearing it again before calling the transaction.

What we are trying to do by this?Can any one explain me.

Please help me out in understanding this.

Thanks in Advance.

5 REPLIES 5
Read only

Former Member
0 Likes
835

"My main doubt is we are clearing the internal table i_bdc_tbl before calling the transaction once we move the value to the specific field.I am not getting what they tried to do there"...

clear itab. " This statement doesn't clear the internal table .This clears only the header. There must be some other problem with the code.

Regards,

Ravi

Read only

Former Member
0 Likes
834

check whether ur passing the internal table data to work area or not before passing the values...Loop at internal table into wa_report...Then all the perform statements needs to be written...

Read only

Former Member
0 Likes
834

What is wa_report whether it is internal table or work area.

if this an internal table then u r not reading the table

Place u r code in between

loop at internaltablename.

// BDC coding

Call transaction statement

endloop.

Read only

Former Member
0 Likes
834

Have a look at below link for info abt BDC.

http://help.sap.com/saphelp_erp2005/helpdata/en/fa/097119543b11d1898e0000e8322d00/frameset.htm

I hope it helps.

Best Regards,

Vibha

*Please mark all the helpful answers