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

bapi_material_savedata

Former Member
0 Likes
1,679

Hi all,

i created a material using bapi_material_savedata, now when im trying to change it. im getting this error "The storage location or picking area does not exist"

but when i used the get_all im getting this data..

could anyone suggest me here.

thanks & regards,

chinta

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,581

guys how should i close this thread ?

chinta

10 REPLIES 10
Read only

Former Member
Read only

0 Likes
1,581

brother, i checked them,,,i did them correctly... i don't have any issues with that.. but still i get this error bro..

Read only

koolspy_ultimate
Active Contributor
0 Likes
1,581

   Hi check this,

REPORT  Z_EXAMPLE_BAPI_MATERIAL_SAVEDATA.

* Data Declarations

DATA:       CLIDAINP  LIKE  BAPI_MARA_GA,

            CLIDAOUT  LIKE  BAPI_MARA,

            CLIDAOUTX LIKE  BAPI_MARAX,

            HEADDATA  LIKE  BAPIMATHEAD,

            RETURN    LIKE  BAPIRET2,

            RETURNMES LIKE BAPI_MATRETURN2 OCCURS 0 WITH HEADER LINE.

* Get Material Number to be processed

PARAMETERS: MATERIAL LIKE  BAPI_MARA_GA-MATERIAL.

* Read Material Data

CALL FUNCTION 'BAPI_MATERIAL_GET_ALL'

  EXPORTING

    MATERIAL                   = MATERIAL

  IMPORTING

    CLIENTDATA                 = CLIDAINP

  TABLES

    RETURN                     = RETURNMES.

* Header Data: Material and View to maintain

HEADDATA-MATERIAL    = MATERIAL.

HEADDATA-BASIC_VIEW  = 'X'.

* Detail Data: Field Value, and 'X'-Structure to mark the field for maintenance

CLIDAOUT-NET_WEIGHT  = CLIDAINP-NET_WEIGHT * 2.

CLIDAOUTX-NET_WEIGHT = 'X'.

* Call the BAPI

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

  EXPORTING

    HEADDATA                   = HEADDATA

    CLIENTDATA                 = CLIDAOUT

    CLIENTDATAX                = CLIDAOUTX

  IMPORTING

    RETURN                     = RETURN

  TABLES

    RETURNMESSAGES             = RETURNMES.

* Commit to release the locks

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

* RETURN-TYPE is 'E' in case of error, else 'S'.

IF RETURN-TYPE = 'E'.

  LOOP AT RETURNMES.

    WRITE: / RETURNMES-MESSAGE.

  ENDLOOP.

ELSEIF RETURN-TYPE = 'S'..

  WRITE: / 'Weight of material ', MATERIAL, 'Sucessfully doubled'.

ENDIF.

Regards,

madhumahesh.

Read only

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Likes
1,581

Can you debug and see what information is getting populated in the RETURN table after calling the bapi. Any information or Warning message there while creating?

Read only

Former Member
0 Likes
1,581

thank you all for your help, i did made a mistake in my code... thank you.

regards

chinta

Read only

Former Member
0 Likes
1,582

guys how should i close this thread ?

chinta

Read only

0 Likes
1,581

click on correct answer whatever correct one  then automatically closed thread

or

click on correct answer whatever u was posted recent one.

Read only

0 Likes
1,581

hi,

i dont see any 'correct answer' to click and close...

Read only

0 Likes
1,581

check below screen:

click on correct answer who was posted correct one  thats all.

way of points :

Helpful answer =  5 points,

Correcet answer =  10 points and closed the thread also

like = 2 points

Read only

0 Likes
1,581

thanks but unfortunately i dont have it on my screen.

im in discussions room...

so am i in a wrong room.. i dont know. but i dont have those. in my screen

regards,

chinta