Skip to Content
author's profile photo Former Member
Former Member

Start routine in transformation rules

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 09:39 PM

    Hello Thomas,

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

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.