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

error in uploading data.

santosh_kumar94
Participant
0 Likes
1,378

Dear experts,

         i want to upload data to tcode mb1b . i am able to upload data to it's 2 screens but the 3rd screen is not taking the data.

it's showing error like field mseg-kdpos doesn't exits in the screen 0002 .

here is my recording :

     PERFORM BDC_DYNPRO      USING 'SAPMM07M' '0400'.
     PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'RM07M-SOBKZ'.
     PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '/00'.
     PERFORM BDC_FIELD       USING 'MKPF-BLDAT'
                                   '27.09.2012'.
     PERFORM BDC_FIELD       USING 'MKPF-BUDAT'
                                   '27.09.2012'.
     PERFORM BDC_FIELD       USING 'RM07M-BWARTWA'
                                   WA-BWARTWA .               " '413'.
     PERFORM BDC_FIELD       USING 'RM07M-SOBKZ'
                                   WA-SOBKZ.         "'E'.
     PERFORM BDC_FIELD       USING 'RM07M-WERKS'
                                   WA-WERKS.                    "   'CH01'.
     PERFORM BDC_FIELD       USING 'RM07M-LGORT'
                                   WA-LGORT .                 " '5001'.
     PERFORM BDC_FIELD       USING 'XFULL'
                                   'X'.
     PERFORM BDC_FIELD       USING 'RM07M-WVERS2'
                                   'X'.

*
     PERFORM BDC_DYNPRO      USING 'SAPMM07M' '0421'.
     PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'MSEG-CHARG(01)'.
     PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '/00'.
     PERFORM BDC_FIELD       USING 'MSEGK-UMLGO'
                                  WA-UMLGO .                 " '5001'.
     PERFORM BDC_FIELD       USING 'MSEGK-UMMAT'
                                  WA-UMMAT .                 " 'san100'.
     PERFORM BDC_FIELD       USING 'MSEG-MATNR(01)'
                                  WA-MATNR  .                 "  'san90'.

    PERFORM BDC_FIELD       USING 'MSEG-ERFMG(01)'
                                   LV_CHAR .               "'2'.
     PERFORM BDC_FIELD       USING 'MSEG-ERFME(01)'
                                   WA-ERFME .              " 'kg'.
     PERFORM BDC_FIELD       USING 'MSEG-CHARG(01)'
                                   WA-CHARG .                "'1563'.
     PERFORM BDC_FIELD       USING 'MSEGK-MAT_KDAUF'
                                   WA-MAT_KDAUF .        "'500000026'.
     PERFORM BDC_FIELD       USING 'MSEGK-MAT_KDPOS'
                                   WA-MAT_KDPOS             . " '10'.
     PERFORM BDC_FIELD       USING 'DKACB-FMORE'
                                  'X'.

perform bdc_dynpro      using 'SAPLKACB' '0002'.
perform bdc_field       using 'BDC_OKCODE'
                               '=ENTE'.
perform bdc_field       using 'BDC_CURSOR'
                               'MSEG-KDPOS'.
perform bdc_field       using 'MSEG-KDAUF'
                               WA-KDAUF.                     
perform bdc_field       using 'MSEG-KDPOS'
                                  WA-KDPOS.                         

perform bdc_field       using 'DKACB-FMORE'
                             LV_FNAM.                       "  record-FMORE_020.
perform bdc_dynpro      using 'SAPLKACB' '0002'.
perform bdc_field       using 'BDC_OKCODE'
                               '=ENTE'.
perform bdc_dynpro      using 'SAPMM07M' '0421'.
perform bdc_field       using 'BDC_CURSOR'
                               'MSEG-ERFMG(01)'.
perform bdc_field       using 'BDC_OKCODE'.

plz help.

11 REPLIES 11
Read only

MariaJooRocha
Contributor
0 Likes
1,282

Hi,

Do you know TC SHDB?

Regards,

Maria João Rocha

Read only

0 Likes
1,282

hi ,

yes i know tc shdb. i have used it for recording mb1b .

Read only

sandeep_katoch
Contributor
0 Likes
1,282

hi santosh,

Try to execute the program in foreground mode by passing the mode as A which will start the program in foreground.

You can consequently check where and on which field and which screen the error is appearing.

By just seeing the recording it is quiet difficult to answer.

Rgds,

Sandeep Katoch

Read only

0 Likes
1,282

dear sir,

            you can see in my recording that whereever i am passing the work area value it's taking the data  but from here it's not updating the data.

this screen is showing error that mseg-kdpos doesn't exit's in the screen. here  wa-kdauf & wa-kdpos is not updating the data.

perform bdc_dynpro      using 'SAPLKACB' '0002'.
perform bdc_field       using 'BDC_OKCODE'
                               '=ENTE'.
perform bdc_field       using 'BDC_CURSOR'
                               'MSEG-KDPOS'.
perform bdc_field       using 'MSEG-KDAUF'
                               WA-KDAUF.                     
perform bdc_field       using 'MSEG-KDPOS'
                                  WA-KDPOS.   


perform bdc_field       using 'DKACB-FMORE'
                             LV_FNAM.


Read only

0 Likes
1,282

Hi,

The error saying that,in the screen '0002' the field is does not exist.Double check the screen number or record it again.

Thanks

Naresh

Read only

0 Likes
1,282

Hi Santosh,

Please cross check once again because in  'SAPLKACB' '0002' these two fields are not there.

Cross check once again  and try to do the recording and check whether the given fields exists in the screen or not.

Why dont you try the debugging in foreground mode because then you will be on the screen itself where it is trying to find the fields.

Rgds,

Sandeep Katoch

Read only

0 Likes
1,282

dear sir,

   i am using movement type - 413. for this movement type it's showing these two fields. again  i have recorded . same things are again coming in the recording. Also, i have debugged it in A- mode . so, for these two fields data is not  updating.

thanks.

Read only

Former Member
0 Likes
1,282

hello,

Why don't you try the BAPI "BAPI_GOODSMVT_CREATE" ? this is good approach and you won't have issues if there is an upgrade in your system. BDC is an old method and needs to be avoided if there is a FM or BAPI to do the sam job.

best regards,

swanand

Read only

0 Likes
1,282

but i have to do  it using bdc.

thanks.

Read only

0 Likes
1,282

Hi,

Well, too bad that you have to do it by using an obsolete method...I really cannot understand that

Moreover, many transactions behave differently when processed in background and, often, a simple recording won't allow an easy background processing...

Anyway when looking at that screen, I can only find COBL-MAT_KDAUF with COBL-MAT_KDPOS or COBL-KDAUF with COBL-KDPOS... Maybe you can try it out by using those fields instead.

But the good way of doing that is by using the correct Bapi.... anything else looks like a mess to me

Cheers,

Manu.

Read only

0 Likes
1,282

BDC should be the LAST possible choice, after all other methods (particularly SAP-written BAPIs) have been exhaused.