Skip to Content
avatar image
Former Member

How to upload long text using BAPI_SERVICE_CREATE

Hi,

I'm uploading service master records (transaction AC03) through my program using function BAPI_SERVICE_CREATE. As per the requirements, for each service number, I've to pass long text also (refer to the last text area on the transaction screen).

In the tables section of the bapi BAPI_SERVICE_CREATE, there is a provision for an internal table on the form SERVICE_LONG_TEXTS. But it is of no use as even if I pass data to it, it is not written to the database.

Can anyone tell me solution for my problem?

Thanks.

Anuj.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 12, 2007 at 04:13 AM

    Thanks MD and Krishna.

    Let me explain the finer details of the program logic.

    I'm uploading service master records from an excel sheet. Now service numbers can be externally provided or internally generated.

    Currently, I am passing the records using BAPI_SERVICE_CREATE and the long text using CREATE_TEXT. The problem is that create_text takes service number as an input and for service numbers created using internal number range, its practically not feasible to retreive the created number during the program execution itself, to be further used in create_text.

    So I hope Krishna you must have understood that your solution is good, but in my case, it is not feasible. This you can check from the transaction text area properties itself.

    MD, as you have asked for the values I'm passing, so here they are:

    SERVICE_LONG_TEXTS-LANGUAGE : 'E'

    *SERVICE_LONG_TEXTS-LANGUAGE_ISO

    *SERVICE_LONG_TEXTS-FORMAT

    SERVICE_LONG_TEXTS-LINE : Any long text

    SERVICE_LONG_TEXTSCHANGE_ID : 'X'

    My only hope is that using the SERVICE_LONG_TEXTS I may be able to pass data. But it is not happening for my test cases.

    Thanks and Regards,

    Anuj.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks Krishna for all the help and patience.

      The problem is resolved and SAVE_TEXT is giving the desired performance.

      BTW, I'm still not sure why CREATE_TEXT was not saving the long text, since in both functions, we are passing exactly the same values!!

      Best Regards,

      Anuj

  • avatar image
    Former Member
    Oct 11, 2007 at 07:31 PM

    Hi Anuj

    What are the values you are passing for following in the BAPI

    Regards

    MD

    SERVICE_LONG_TEXTS-LANGUAGE

    SERVICE_LONG_TEXTS-LANGUAGE_ISO

    SERVICE_LONG_TEXTS-FORMAT

    SERVICE_LONG_TEXTS-LINE

    SERVICE_LONG_TEXTSCHANGE_ID

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 11, 2007 at 11:51 PM

    Usuall for long text you may have to explicitly call SAVE_TEXt upon successfull completion of BAPI. Something like shown below

    call function 'SAVE_TEXT'

    EXPORTING

    header = s_thead

    insert = 'X'

    TABLES

    lines = tlines

    EXCEPTIONS

    others = 1.

    if sy-subrc = 0.

    call function 'COMMIT_TEXT'

    EXPORTING

    savemode_direct = 'X'.

    endif.

    Add comment
    10|10000 characters needed characters exceeded