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: 

HELP WITH CODE FOR BDC

Former Member
0 Kudos
190

Hi all,

iam having an issue with bdc for mmsc t-code

This is the code iam having

form populating_i_bdctab.

clear : wa_itab.

data: a_line(20) type c.

data : begin of i_mard occurs 0.

include structure mard.

data: end of i_mard.

data: l_string type string.

loop at itab into wa_itab.

select * from mard into table i_mard where matnr = wa_itab-matnr and

werks = wa_itab-werks.

describe table i_mard lines a_line.

a_line = a_line + 1.

condense a_line.

perform bdc_dynpro using 'SAPMM03M' '0105'.

perform bdc_field using 'BDC_CURSOR'

'RM03M-MATNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RM03M-MATNR'

wa_itab-matnr.

perform bdc_field using 'RM03M-WERKS'

wa_itab-werks.

perform bdc_field using 'RM03M-LFLAG'

'X'.

perform bdc_dynpro using 'SAPMM03M' '0195'.

clear l_string.

concatenate 'RM03M-LMINB(' a_line ')' into l_string.

perform bdc_field using 'BDC_CURSOR'

'RM03M-LMINB(05)'.

perform bdc_field using 'BDC_OKCODE'

'=BU'.

clear l_string.

concatenate 'RM03M-LGORT(' a_line ')' into l_string.

perform bdc_field using l_string

wa_itab-lgortt.

clear l_string.

concatenate 'RM03M-RLGOR(' a_line ')' into l_string.

perform bdc_field using l_string

wa_itab-lgortf.

CLEAR L_STRING.

CONCATENATE 'RM03M-LPGBE(' A_LINE ')' INTO L_STRING.

*perform bdc_field using L_STRING

  • wa_itab-lpgbe. ------ This thing doesn't work L_STRING = RM03M-LPGBE(7)

ERROR -Field RM03M-LPGBE(7) does not exist in the screen SAPMM03M 0195

perform bdc_field using 'RM03M-LGPBE(07)' -


This thing works

wa_itab-lpgbe.

clear l_string.

concatenate 'RM03M-DISKZ(' a_line ')' into l_string.

perform bdc_field using l_string

wa_itab-diskz.

clear l_string.

concatenate 'RM03M-LMINB(' a_line ')' into l_string.

perform bdc_field using l_string

wa_itab-lminb.

perform bdc_insert.

clear : wa_itab.

endloop.

wHEN I USE THE L_STRING I DON'T SEE THE VALUE ON THE SCREEN.

i AM BIT CONFUSED AS TO WHY IT DOESN'T WORK WHEN ALL OTHER FIELDS ARE BEING POPULATED

lET ME KNOW

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
118

Try making sure that you have the leading zero in L_STRING for the index? Does it work now? If so, then you know that you need to account for this. You can use a type N field with length of 2 to do the conversion from 7 -> 07

Regards,

Rich Heilman

10 REPLIES 10

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
119

Try making sure that you have the leading zero in L_STRING for the index? Does it work now? If so, then you know that you need to account for this. You can use a type N field with length of 2 to do the conversion from 7 -> 07

Regards,

Rich Heilman

0 Kudos
118

Hi Rich ,

i tried doing this as well

data : a type c.

a = 0.

concatenate a A_LINE into a_line.

CLEAR L_STRING.

CONCATENATE 'RM03M-LPGBE(' A_LINE ')' INTO L_STRING.

perform bdc_field using L_STRING

wa_itab-lpgbe.

l_string = RM03M-LPGBE(07)

Even then i have the same error

Thanks

let me know

0 Kudos
118

I'm showing the field name in my system as LGPBE not LPGBE. So I believe that this is your issue. Change the name of the field in your BDC, and you should be good to go.

Regards,

Rich HEilman

0 Kudos
118

Hi Rich,

My bad

Thanks you're right.

Thanks for everyone of you

Anyhow that was a great catch

Thanks again

Former Member
0 Kudos
118

Hi,

Use SHDB to record the transaction and check how the values are populated in the screen fields..

Thanks

Naren

Former Member
0 Kudos
118

HI David,

Ensure that your index specification is in the form of '01' 02' '03'.

The other reason could be. you are trying to populate the 7th line of the table control.. and during run time .. the program might only find 6 lines... use page down logic for the table control.. after every 6 lines..

Thanks

Mahesh

0 Kudos
118

Hi all,

The page down is not an issue because i see all other values being populated which belong to to the same row

SHDB recording shows the value of the row even for this field as (07) or (08) depends on the row

I can send the entire code if you want

Thanks

0 Kudos
118

Try something like :

data g_ctr(2) type n.

g_ctr = 0.

LOOP AT t_tcdata.

g_ctr = g_ctr + 01.

CONCATENATE c_matnr '( ' g_ctr ' ) ' INTO g_mabnr.

PERFORM f_bdc_field USING g_mabnr g_matnr. "t_tcdata-matnr..

CONCATENATE c_kdmat '( ' g_ctr ' ) ' INTO g_kdmat.

PERFORM f_bdc_field USING g_kdmat t_tcdata-kdmat.

CONCATENATE c_kwmeng '( ' g_ctr ' ) ' INTO g_kwmeng.

PERFORM f_bdc_field USING g_kwmeng t_tcdata-kwmeng.

endloop.

Thanks

Seshu

Former Member
0 Kudos
118

any help would be appreciated

Former Member
0 Kudos
118

Hi,

Sorry...what is the issue??Please let us know.

Thanks

Naren