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

va02 bapi upload data from excelsheet into sap

Former Member
0 Likes
655

hi,

iam working on va02 bapi upload data from excelsheet into sap.

but when iam executing it iam getting an error:

Error :

SD document 4970 is not in the database or has been archived

for VBELN: 4970

for any sales orderno its giving the same error.

thanks

Edited by: Julius Bussche on Dec 5, 2008 12:23 PM

3 REPLIES 3
Read only

GauthamV
Active Contributor
0 Likes
563

hi,

First check the existing orders in your system from va03 or vbak,vbap tables and then

try to use the bapi.

Read only

Former Member
0 Likes
563

>

> hi,

>

> iam working on va02 bapi upload data from excelsheet into sap.

> but when iam executing it iam getting an error:

>

> Error :

> SD document 4970 is not in the database or has been archived

> for VBELN: 4970

> for any sales orderno its giving the same error.

> thanks

Hi

That is because of the leading zeroes, If you see in the database table..the value 4970 will be stored like this:000004970. So, as there is mismatch between your excel value and the one in database..it is giving that error.

So, Use Conversion FM like this before passing the number to BAPI:

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    INPUT         = vbeln    "variable or internal table field which holds the excel values.
 IMPORTING
   OUTPUT        = vbeln
.

Regards,

Vishwa.

Read only

Former Member
0 Likes
563

hii

this error comes because value you are entering is wrong.here you have two optios to remove this error.first you need to enter same length value like '0000004970' like this in excel sheet.second solution is to use following FM.

data:

 w_vbeln        LIKE vbak-vbeln.

    w_vbeln    = ls_data-vbeln.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = w_vbeln
          IMPORTING
            output = w_vbeln.

        ls_data-vbeln  = w_vbeln.

regards

twinkal