cancel
Showing results for 
Search instead for 
Did you mean: 

Start routine in transformation rules

Former Member
0 Kudos

Hi,

I tried bit with the coding of the start routine for the transformation rules.

I try to cancel the update process if at least one data set is not valid in the table /BIC/QY0HDIVSN (master data of infoobject division) and if the data set is not marked with status (ls_data_package-/BIC/Y0HSTATUS) 'X' or 'x' (this should allow administrators to load also data into the system that is not valid in table /BIC/QY0HDIVSN).

This is how the coding looks like:

TABLES: /BIC/QY0HDIVSN,

Y0HGHCPUPL.

DATA: ls_data_package TYPE DATA_PACKAGE_STRUCTURE,

ls_monitor TYPE RSMONITOR.

CLEAR MONITOR.

LOOP AT DATA_PACKAGE INTO ls_data_package.

IF ls_data_package-/BIC/Y0HSTATUS <> 'X' AND

ls_data_package-/BIC/Y0HSTATUS <> 'x'.

SELECT SINGLE * FROM /BIC/QY0HDIVSN

WHERE /bic/y0hcomp1 = ls_data_package-/BIC/Y0HCOMP1 AND

/bic/y0hdiv1 = ls_data_package-/BIC/Y0HDIV1 AND

DATEFROM <= ls_data_package-CALMONTH AND

DATETO >= ls_data_package-CALMONTH.

IF sy-subrc <> 0.

DELETE DATA_PACKAGE INDEX sy-tabix.

  • send message to the monitor

MONITOR-MSGID = 'RSM'.

MONITOR-MSGTY = 'E'.

MONITOR-MSGNO = '799'.

CONCATENATE 'Company' ls_data_package-/BIC/Y0HCOMP1

INTO MONITOR-MSGV1 SEPARATED BY space.

CONCATENATE 'and Division' ls_data_package-/BIC/Y0HDIV1

INTO MONITOR-MSGV2 SEPARATED BY space.

MONITOR-MSGV3 = 'is not a valid combination for period'.

MONITOR-MSGV4 = ls_data_package-CALMONTH.

APPEND MONITOR.

  • if abort is not equal zero, the update process will be canceled

ABORT = 1.

ELSE.

ABORT = 0.

ENDIF.

ELSE.

ABORT = 0.

ENDIF.

ENDLOOP.

The coding works fine in general.

But a few points could be improved:

1.) I would like to send a Warning message to the Monitor ('Validation turned off') if status = 'X'. I tested a bit, but either the message did not appear in monitor or the update process was canceled though ABORT was 0.

I tried MONITOR-MSGTY = 'W'. Is it possible to send just an information to the monitor or will the warning message always prevent the process from becoming 'green'?

2.) It seems that if an request correctly fails due to an excisting error, the next request (no error anymore in the data packages) will still fail with message 'abort in customer routine 9998'. First request was deleted in the meantime. It seems I have to wait a short time till I can start the request without an error again.

Do you have any ideas?

Thanks a lot for your help!

Regards,

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Thomas,

Shouldn't your IF Condition have 'OR' instead of 'AND'?

Thanks

Former Member
0 Kudos

Hello George,

as the code below the if condition should be executed if 'X' AND 'x' both are not set in status field (to avoid problems with capital letters) the if clause seems to be correct.

Thanks for your help,

Thomas