‎2016 Apr 11 2:09 PM
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
‎2016 Apr 11 4:51 PM
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
‎2016 Apr 12 8:57 AM
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.
‎2016 Apr 12 2:15 PM
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.