Application Development and Automation 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: 
Read only

Create profile in batch mode

Former Member
0 Likes
688

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!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
601

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.

2 REPLIES 2
Read only

Former Member
0 Likes
602

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.

Read only

0 Likes
601

If this is resolved kindly close the discussion - see this blog. Your own reply can be marked as correct answer.