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: 

Update long text description using BAPI_CLASS_CREATE

former_member374952
Participant
0 Kudos

Hi,

I created a class for class type "001" using BAPI_CLASS_CREATE. It works fine.   But have issues while updating the Long Text :


How to populate the long text and pass it as a parameter to the CLASSLONGTEXTS   Bapi ?


Here is my code trying to update multiple lines for the long text.


data: it_class_long_texts LIKE BAPI1003_LONGTEXT OCCURS 0 WITH HEADER LINE.


**Class Long Texts En

*Long text line 1

      it_class_long_texts-LANGU      = 'EN'.

      it_class_long_texts-LANGU_ISO  = 'EN'.

      it_class_long_texts-TEXT_DESCR = 'line 1 for long text'.

       it_class_long_texts-TEXT_LINE  = 1.

      APPEND it_bapi_class_long_texts.


*Long text line 2

      it_class_long_texts-LANGU      = 'EN'.

      it_class_long_texts-LANGU_ISO  = 'EN'.

      it_class_long_texts-TEXT_DESCR = 'line 2 for long text'.

      it_class_long_texts-TEXT_LINE  = 2.

      APPEND it_bapi_class_long_texts.


CALL FUNCTION 'BAPI_CLASS_CREATE'

     EXPORTING

       CLASSNUMNEW       = LV_CLASS_NAME    

       CLASSTYPENEW      = '001'                 

       CLASSBASICDATA    = lv_cls_bas_dat

       CLASSSTANDARD     = lv_cls_standard

     TABLES

       RETURN            =                     it_bapi_return

       CLASSDESCRIPTIONS = it_bapi_cls_desc

       CLASSLONGTEXTS    = it_class_long_texts.

Regards,

Vicky

3 REPLIES 3

former_member226239
Contributor
0 Kudos

If the class is already created then you may have to use 'BAPI_CLASS_CHANGE' not 'CREATE'.

OR else the issue is with 'append it_bapi_class_long_texts'. It should be 'append it_class_long_texts'.

-Chandra

0 Kudos

If I pass the parameter for CLASSLONGTEXTS , then have issues in creating the Class. Otherwise the Bapi for creating the class works fine. Am looking for Bapi syntax code  for Updating the long text while creating Class.  

0 Kudos

Can you just add one line and see what happens? Just use the following code:

it_class_long_texts-langu = 'EN'.

it_class_long_texts-text_descr = 'line 1 for long text'.

append it_class_long_texts.

If it does not work then copy and paste your code.