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: 

BAPI_SERVICE_CREATE

Former Member
0 Kudos

Hi

Could any plz post the sample code for BAPI_SERVICE_CREATE

2 REPLIES 2

Former Member
0 Kudos

Hi Roshik,

As you required, I'm posting here the relevant lines of my code and data declarations as well.

-


DATA:

C_FOBJECT(10) TYPE C VALUE 'ASMD',

C_FID(4) TYPE C VALUE 'LTXT',

L_PASS_SPRAS TYPE BAPISRV_ASMD-MASTER_LANGU,

L_FNAME TYPE THEAD-TDNAME,

L_SERVICE_RET TYPE BAPISRV_ASMD-SERVICE.

L_PASS_SPRAS = 'E'.

CALL FUNCTION 'BAPI_SERVICE_CREATE'

EXPORTING

IM_SERVICE_DATA = L_SERVICE_DATA

IM_SERVICE_DATAX = L_SERVICE_DATAX

IMPORTING

SERVICE = L_SERVICE_RET

TABLES

RETURN = IT_RET

SERVICE_DESCRIPTION = IT_SERV_DESC.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

L_FNAME = L_SERVICE_RET.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

FID = C_FID

FLANGUAGE = L_PASS_SPRAS

FNAME = L_FNAME

FOBJECT = C_FOBJECT

TABLES

FLINES = IT_LONG_TEXT

-


<b>Kindly reward points if you found the reply helpful.<b>

Cheers,

Chaitanya.

Former Member
0 Kudos

hi,

Please check this code it might help you...

DATA :
      SERVICE like
        BAPISRV_ASMD-SERVICE,
      EX_SERVICE_DATA like
        BAPISRV_ASMD,
      EX_SERVICE_DATAX like
        BAPISRV_ASMDX,
      IM_SERVICE_DATA like
        BAPISRV_ASMD,
      IM_SERVICE_DATAX like
        BAPISRV_ASMDX,
      NO_NUMBER_RANGE_CHECK like
        BAPIFLAG-BAPIFLAG,
      TESTRUN like
        BAPIFLAG-BAPIFLAG,

      RETURN like BAPIRET2
                  occurs 0 with header line,
      SERVICE_DESCRIPTION like BAPISRV_ASMDT
                  occurs 0 with header line,
      SERVICE_LONG_TEXTS like BAPISRV_TEXT
                  occurs 0 with header line,
      EXTENSION_IN like BAPIPAREX
                  occurs 0 with header line,
*   call BAPI-function in this system                                  *
    CALL FUNCTION 'BAPI_SERVICE_CREATE'
      EXPORTING
        IM_SERVICE_DATA       = IM_SERVICE_DATA
        IM_SERVICE_DATAX      = IM_SERVICE_DATAX
        NO_NUMBER_RANGE_CHECK = NO_NUMBER_RANGE_CHECK
        TESTRUN               = TESTRUN
      IMPORTING
        SERVICE               = SERVICE
        EX_SERVICE_DATA       = EX_SERVICE_DATA
        EX_SERVICE_DATAX      = EX_SERVICE_DATAX
      TABLES
        RETURN                = RETURN
        SERVICE_DESCRIPTION   = SERVICE_DESCRIPTION
        SERVICE_LONG_TEXTS    = SERVICE_LONG_TEXTS
        EXTENSION_IN          = EXTENSION_IN
      EXCEPTIONS
        OTHERS                = 1.
    IF SY-SUBRC <> 0.
    ENDIF.

You can go through Documentation of this BAPI (FM)....

Which will help you for further clarification....

Cheers.

Sagun Desai...