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 Call Transaction Method

Former Member
0 Likes
1,316

Hi Friends,

When i try to call vk13 transaction and pass the screen field values for the second screen and execute it it is displaying properly.But when i try to pass the different value in the bcddata internal table it is changing properly but in the screen it not updating that value.Alawly the screen fields are taking the values passed the first time.But in the internal table which we are oassing to the calltransaction it is changing correctly but not in the corresponding screen fields. Why it is happening so. Can any one help me out of this problem.

Thanks in Advance.

Hi Friends,

When i try to call vk13 transaction and pass the screen field values for the second screen and execute it it is displaying properly.But when i try to pass the different value in the bcddata internal table it is changing properly but in the screen it not updating that value.Alawly the screen fields are taking the values passed the first time.But in the internal table which we are oassing to the calltransaction it is changing correctly but not in the corresponding screen fields. Why it is happening so. Can any one help me out of this problem.

Thanks in Advance.

9 REPLIES 9
Read only

dani_mn
Active Contributor
0 Likes
1,188

HI,

After CALL TRANSACTION you should refresh BDCDATA internal table.

Are you doing this?

Regards,

Read only

Former Member
0 Likes
1,188

while passing from internal table after 1 record has been passed, clear the header of the internal table...then pass the second record...

also, after first record ru saving the data and then passing the second record.

Read only

Former Member
0 Likes
1,188

Hi

After inserting price type in VK13, a report is called and I don't believe a BDC can work with selection-screen.

U can directly do a SUBMIT.

The name of the report should be RV13XXXX, where XXXX is the table number of the sequence you've chosen

Max

Read only

0 Likes
1,188

I am not passing through the selection screen . It is like iteractive report. when i select the particular line in the list output then the screen fields should take the values from that selected line. First time when i select the line it is taking properly.

But next time when i select the line the content of the i_bdc_tbl is changing correctly but when it enter in to the transaction it is not taking the values from the i_bdc_tbl. Simply it is displaying the screen fields with the old values. It is not updating the screen fields with the values from the i_bdc_tbl. Why the screen fields are not replaced with the value of i_bdc_tbl? Why it is not getting refreshed with the new values?

Just i am posting the bdc portion of my code here. So you can help me out on this.

AT LINE-SELECTION.

SELECT SINGLE kozgf FROM t685 INTO v_kozgf

WHERE kschl = wa_report-kschl.

SELECT kolnr kotabnr FROM t682i INTO TABLE i_t682i

WHERE kozgf = v_kozgf.

SORT i_t682i BY kolnr.

READ TABLE i_t682i WITH KEY kotabnr = wa_report-tabna+1(3)

TRANSPORTING NO FIELDS.

CHECK sy-subrc = 0.

v_index = sy-tabix.

REFRESH i_bdc_tbl.

l_tabix = '01'.

PERFORM f_vk13.

CONCATENATE 'RV13' wa_report-tabna INTO v_bdc_val_field.

PERFORM bdc_dynpro USING v_bdc_val_field '1000'.

PERFORM bdc_field USING 'BDC_CURSOR'

'F004-LOW'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ONLI'.

CREATE DATA v_rec TYPE (wa_report-tabna).

ASSIGN v_rec->* TO <wa_table>.

SELECT SINGLE * FROM (wa_report-tabna) INTO <wa_table>

WHERE kschl = wa_report-kschl AND matnr = wa_report-matnr AND knumh = wa_report-objectid.

CALL FUNCTION 'DDIF_FIELDINFO_GET'

EXPORTING

tabname = wa_report-tabna

TABLES

dfies_tab = lwa_tabna

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3.

READ TABLE lwa_tabna WITH KEY fieldname = 'KSCHL'.

p1 = sy-tabix + 1.

READ TABLE lwa_tabna WITH KEY fieldname = 'MATNR'.

p2 = sy-tabix.

LOOP AT lwa_tabna.

v_field = lwa_tabna-fieldname.

IF lwa_tabna-position BETWEEN p1 AND p2.

ASSIGN COMPONENT lwa_tabna-position OF STRUCTURE <wa_table> TO <fld>.

PERFORM f_vk13_s2 USING lwa_tabna-fieldname <fld>.

ENDIF.

ENDLOOP.

PERFORM bdc_field USING 'RV130-DATAM'

wa_report-fdate_value_new.

PERFORM bdc_field USING 'BDC_OKCODE'

'ONLI'.

PERFORM bdc_field USING 'BDC_CURSOR'

'F001'.

CALL TRANSACTION 'VK13' USING i_bdc_tbl

MODE 'A'.

FORM f_vk13.

DATA: l_tabix(2) TYPE c.

*Condition type

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.

*Key combination

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)'

''.

l_tabix = v_index.

SHIFT l_tabix RIGHT.

OVERLAY l_tabix WITH '00'.

CONCATENATE 'RV130-SELKZ(' l_tabix ')' INTO v_bdc_field.

PERFORM bdc_field USING v_bdc_field

'X'.

ENDFORM. "f_vk13

*----


  • FORM BDC_DYNPRO

*

  • This form accepts the program name and screen number

  • and places the values into the I_BDC_TBL internal table.

*

*----


FORM bdc_dynpro USING program dynpro.

CLEAR wa_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 F_BDC_FIELD

*

  • This form accepts the field name and the corresponding value

  • for that field and places them into the I_BDC_TBL internal table.

*

*----


FORM bdc_field USING fnam fval.

CLEAR wa_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

&----


*& Form f_vk13_s2

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f_vk13_s2 USING p_fieldname p_fld.

CONCATENATE wa_report-tabna '-' p_fieldname INTO v_bdc_val_field.

CHECK NOT p_fld IS INITIAL.

PERFORM bdc_field USING v_bdc_val_field p_fld.

ENDFORM. " f_vk13_s2

Thanks.

Read only

Former Member
0 Likes
1,188

Hi Ram,

You need to Refresh the BDCDATA table every time, i mena this statment should be in the loop starting point or end of the CALL TRANSACTION statment ..

Regards

Sudheer

Read only

0 Likes
1,188

I have done that in both place even then the same problem only. When i enter in to the tansaction again the screen fields are not refreshed it is having only the old values.

Read only

former_member69765
Contributor
0 Likes
1,188

Very simple.... refresh BDCDATA table before u populate with next record...

Read only

Former Member
0 Likes
1,188

Hi Ram,

I think i understood your Problem, It is not with Refreshing, may be you have not included the statements inside the LOOP ....... ENDLOOP.

Loop at Itab_bdc. " BDC Internal table in which you have the records.

...

...

Endloop.

Reward Points if found usefull.

Cheers...

Santosh.

Read only

0 Likes
1,188

I am just having single record at every line selection of list output. So i think no need to loop that table.