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

Re:long text upload

Former Member
0 Likes
702

Hi

I am trying to use BAPI to create material master (MM01) where i need to read the data from the application server and upload.I need to schedule a background job for this.

Now the problem is with long text.how can i upload the long text from that flat file.I tried with the table parameter MATERIALLONGTEXT but it is not working.

Please help...

Regards

Vamshi

Hi

I am trying to use BAPI to create material master (MM01) where i need to read the data from the application server and upload.I need to schedule a background job for this.

Now the problem is with long text.how can i upload the long text from that flat file.I tried with the table parameter MATERIALLONGTEXT but it is not working.

Please help...

Regards

Vamshi

4 REPLIES 4
Read only

laurent_fournier2
Contributor
0 Likes
676

Hi,

The BAPI works well as far as I know. Can you please paste your code ?

Read only

0 Likes
676

Hi,

In BAPI structure MATERIALLONGTEXT am passing the following

APPLOBJECT-- MATERIAL

TEXT_NAME -- mat. no.

TEXT--BEST

LAN--EN

Text_line-- long text

but it is throwing an error material number in initial.

Read only

0 Likes
676

Hi again,

I believe that you have internal numbering so the material number is not yet known when you call the BAPI. I'm not sure if you can somehow bypass this but you could try the following :

Call the bapi without longtext in order to create the material and get the newly created material number.

Call the bapi again passing only the longtexts for the material number just created.

Another way is to use 'SAVE_TEXT' FM again when you know the material number.

Regards.

Read only

0 Likes
676

Hi,

Also, the reason of the error might be that you passing some parameters in BAPI which is not allowed in creating a material, but only allowed in updating alredy an existing material. Such parameters might be VALUATIONDATA, for instance. If so, then you should call bapi twice - first to create material, second to update it passing VALUATIONDATA. Thereby, if you get data from file to creat materials, you shoul have two record for each material. One to create an initial material another to bring it additional data including  VALUATIONDATA, MATERIALLONGTEXT , etc...

Hope it helps,

Zhumabek