Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Create profile in batch mode

Hi everybody,

Since my original post got lost, somehow, I'm creating a new discussion.

I'm trying to create a historic profile using ABAP:

REPORT ZTEST.

DATA PROFHEAD TYPE EPROFHEAD_AUTO.

START-OF-SELECTION.

CALL FUNCTION 'ISU_NUMBER_GET'

  EXPORTING

    NR_RANGE_NUMBER = '01'

    OBJECT = 'ISU_EDMP'

  IMPORTING

    NUMBER = PROFHEAD-PROFILE

  EXCEPTIONS

    NO_RANGE_NUMBER_FOUND         = 1

    NUMBER_NOT_IN_INTERVALL       = 2

    INTERVAL_NOT_FOUND            = 3

    QUANTITY_IS_0                 = 4

    INTERVAL_TE009_INCONSISTENT   = 5

    NUMBER_INVALID                = 6

    INTERVAL_OVERFLOW             = 7.

PROFHEAD-HEAD-PROFTEXT = 'TEST2'.

PROFHEAD-HEAD-SPARTE = '01'.

PROFHEAD-HEAD-PROFTYPE = '01'.

PROFHEAD-HEAD-PROFVALCAT = '01'.

PROFHEAD-HEAD-INTSIZEID = '60'.

PROFHEAD-HEAD-MASS = 'MWH'.

PROFHEAD-HEAD-PROFDECIMALS = '06'.

PROFHEAD-HEAD-PROFOFFSET = '000'.

PROFHEAD-HEAD-FORWARD_ORIENTED = 'X'.

PROFHEAD-HEAD-DATEFROM = '20150101'.

PROFHEAD-HEAD-TIMEFROM = '000000'.

PROFHEAD-HEAD-DATETO = '99991231'.

PROFHEAD-HEAD-TIMETO = '235959'.

PROFHEAD-HEAD-WAERS = ''.

PROFHEAD-HEAD-DAY_OFFSET = '000000'.

PROFHEAD-HEAD-TIME_ZONE = 'CET'.

CALL FUNCTION 'ISU_S_PROFHEAD_CREATE'

  EXPORTING

    X_UPD_ONLINE  = 'X'

    X_NO_DIALOG   = 'X'

    X_NO_COMMIT   = ''

    X_AUTO        = PROFHEAD

  IMPORTING

    Y_PROFILE = PROFHEAD-PROFILE

  EXCEPTIONS

    INVALID_KEY   = 1

    FOREIGN_LOCK  = 2

    INPUT_INVALID = 3

    SYSTEM_ERROR  = 4.

END-OF-SELECTION.

The new profile number is reserved but there is no profile created.

The return code of the ISU_S_PROHEAD_CREATE function is 4 (system error).

Can anybody please give me a hint on how to solve the problem?

Thanks!

replied

Problem solved!

Seams like you have to leave the profile number blank.

So, the working solution is:

REPORT ZTEST.

DATA PROFHEAD TYPE EPROFHEAD_AUTO.

START-OF-SELECTION.

*CALL FUNCTION 'ISU_NUMBER_GET'

*  EXPORTING

*    NR_RANGE_NUMBER = '01'

*    OBJECT = 'ISU_EDMP'

*  IMPORTING

*    NUMBER = PROFHEAD-PROFILE

*  EXCEPTIONS

*    NO_RANGE_NUMBER_FOUND         = 1

*    NUMBER_NOT_IN_INTERVALL       = 2

*    INTERVAL_NOT_FOUND            = 3

*    QUANTITY_IS_0                 = 4

*    INTERVAL_TE009_INCONSISTENT   = 5

*    NUMBER_INVALID                = 6

*    INTERVAL_OVERFLOW             = 7.

PROFHEAD-HEAD-PROFTEXT = 'TEST2'.

PROFHEAD-HEAD-SPARTE = '01'.

PROFHEAD-HEAD-PROFTYPE = '01'.

PROFHEAD-HEAD-PROFVALCAT = '01'.

PROFHEAD-HEAD-INTSIZEID = '60'.

PROFHEAD-HEAD-MASS = 'MWH'.

PROFHEAD-HEAD-PROFDECIMALS = '06'.

PROFHEAD-HEAD-PROFOFFSET = '000'.

PROFHEAD-HEAD-FORWARD_ORIENTED = 'X'.

PROFHEAD-HEAD-DATEFROM = '20150101'.

PROFHEAD-HEAD-TIMEFROM = '000000'.

PROFHEAD-HEAD-DATETO = '99991231'.

PROFHEAD-HEAD-TIMETO = '235959'.

PROFHEAD-HEAD-WAERS = ''.

PROFHEAD-HEAD-DAY_OFFSET = '000000'.

PROFHEAD-HEAD-TIME_ZONE = 'CET'.

CALL FUNCTION 'ISU_S_PROFHEAD_CREATE'

  EXPORTING

    X_UPD_ONLINE  = 'X'

    X_NO_DIALOG   = 'X'

    X_NO_COMMIT   = ''

    X_AUTO        = PROFHEAD

  IMPORTING

    Y_PROFILE = PROFNUM

  EXCEPTIONS

    INVALID_KEY   = 1

    FOREIGN_LOCK  = 2

    INPUT_INVALID = 3

    SYSTEM_ERROR  = 4.

END-OF-SELECTION.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question