Input conversion

Which method (if it exists) can i use if I want to convert my hexadecimal input to a binary format that is compatible with DES operations?

Hexadecimal encding is not rooted in DES, it is a general encoding scheme tto convert binary data to ASCII data.
It is very easy to write your own converter but I would suggest that you take a look at
http://jakarta.apache.org/commons/codec/ .

Similar Messages

  • Data collection: Conversion exit and Input Conversion of Local Currency

    Hi,
    I'm collecting transaction data from BI where the local currency for one company has no decimal places.
    Therefore if I collect the data with no conversion, the value is multiplied by 100 in BCS .
    has anyone used the Conversion Exit or Input Conversion options?
    - any feedback, tips or useful documentation/links you can point me to?
    All help much appreciated.
    TheScotsman

    Hi TheScotsman,
    I'm almost sure that the reason of this behaviour but the special treatment of some specific currencies (see the OSS note 153707). Just check if you have the currency in the TCURX table.
    If yes, then please go through the links:
    Re: Local Currency COP, KRW values wrong in report
    (I described symptoms)
    Re: Currency conversion cube to report
    (see the document in the link)
    Edited by: Eugene Khusainov on Sep 8, 2008 4:20 PM

  • Problem with conversion failed

    I have two inputDate control, one for start_date, the other for end_date.
    Each inputDate has a convertDateTime and a validator that check whether start_date is smaller than end_date.
    First, I input the valid date data, all thing is OK.
    Then, I input a invalid string such as "a" in end_date and start_date, the error messages displayed.
    Then, I input a valid date data in end_date. After the conversion complete, the validation is executing.
    When I want to get the start_date value, the value is not the "a" but the valid value before.
    How can I get the failed data or failed status ? Or skip the validation when one input conversion failed?
    Thanks.

    I think the problem is a spelling error: you named your structure "structs" and then you refer to it as "struct".
    You have to choose one between the two (or a better one if you can find it).
    About File content conversion I suggest you to see the following links:
    Content Conversion (Pattern/Random content in input file)
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    File Content Conversion for Unequal Number of Columns
    /people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
    How to send a flat file with fixed lengths to XI 3.0 using a Central File Adapter
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    Content Conversion ( The Key Field Problem )
    /people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
    Solution to the problem encountered using Variable Substitution with XI-SP12
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    I hope this will be helpfull.
    Regards,
    Salvatore

  • How to suppress automatic keyfigure conversion in WD ALV?

    Dear experts,
    I am having a problem with automatic input conversion in WD ALV.
    I have a key-figures (type P length 9, decimals 2)in my ALV which has reference field of type if_salv_wd_c_field_settings=>reffieldtype_curr.
    I process the changes by event ON_DATA_CHANGE which passes this change object:
    r_param->t_modified_cells
    r_param->t_inserted_rows
    r_param->t_deleted_rows
    r_param->t_error_cells
    The thing is that the changes in table r_param->t_modified_cells are already converted into internal format. When user enters "1", I get here in this table value "1.00". But this internal value is not always correct because corresponding reference field with currency key may not be known yet (it is calculated later on background from other fields).
    Therefore, for example for currency JPY which has no decimal places external value "1" is converted into wrong internal value "1.00" (the correct internal value is "0.01").
    Therefore, I need to suppress the conversion by the ALV and do it myself once the currency key is known.
    How can I suppress the automatic input conversion which is done by ALV?
    There is no such problem in SAP GUI ALV! There is event DATA_CHANGE with similar change object:
    io_data_change->mt_good_cells
    io_data_change->mt_mod_cells
    io_data_change->mt_inserted_rows
    io_data_change->mt_deleted_rows
    But all the changes in table io_data_change->mt_mod_cells are in an external format (exactly the way user entered them on the screen)!
    Any idea?
    Thank you in advance for your help.
    Tomas
    Edited by: Tomas Havlik on Oct 5, 2010 10:24 AM

    I have contacted the Web Dynpro ALV support directly to find out the answer.
    There is no solution!
    The WD ALV always convert the key figure into internal format. It is not possible to get the raw user input in WD as it is in SAP GUI.
    Therefore, I use a workaround in my application - I remeber the number of decimal places of the old currency key and if the new currency key has different number of decimal places, then I shift the decimal point to the right or left correspondingly.

  • Reg : date format conversion from dd.mm.yyyy to mmddyyyy

    hi ALL,
    is there any function module which can convert date format
    from <b>dd.mm.yyyy to mmddyyyy</b>.
    Thanks in advance

    Hi,
    Please check the following
    CONVERSION_EXIT_PDATE_INPUT Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
    CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY
    SCA1 Date: Conversion
    CONVERSION_EXIT_IDATE_INPUT External date INPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    CONVERSION_EXIT_SDATE_INPUT External date (e.g. 01.JAN.1994) INPUT conversion exit
    CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    TB01_ADDON
    CONVERSION_EXIT_DATEX_INPUT
    CONVERSION_EXIT_DATEX_OUTPUT
    Hope this would surely help you out.
    Thanks and regards,
    Varun.

  • What is conversion routine which is found in data element

    Hi all,
    I was just trying to creating a data element assigned to a particular domain in se11. While i am creating i can see a conversion routine
    Can anyone tell me what is the use of that conversion routine with an example.
    thanxs in advance
    hari

    Hi,
    Depending on the data type of the field, there is a conversion when the contents of a screen field are converted from display format to SAP-internal format and vice versa. If this standard conversion is not suitable, it can be overridden by defining a conversion routine in the underlying domain.
    Conversion routines are identified by a five-place name and are stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:
    CONVERSION_EXIT_xxxxx_INPUT
    CONVERSION_EXIT_xxxxx_OUTPUT
    The INPUT module converts from display format to internal format, and the OUTPUT module converts from internal format to display format.
    When is a Conversion Routine Executed?
    If a screen field refers to a domain with a conversion routine, this conversion routine is executed automatically when entries are saved in this screen field or when values are displayed in this screen field. The conversion routine of the domain is also triggered when the field contents are output with the WRITE statement.
    Table SPFLI in the  flight model contains information about the flights offered by the carriers. The time for each flight is recorded in field FLTIME. Enter and display the time of the flight in input templates in the form HHH:MM (hours:minutes). Store the flight time entered in the database as an integer number (number of minutes of the flight). An entry 3:27 is therefore stored in the database as 207 (3 hours, 27 minutes = 207 minutes).
    Field FLTIME refers to domain S_DURA, to which conversion routine SDURA is assigned. The value is thus converted by the two function modules <b>CONVERSION_EXIT_SDURA_INPUT</b> and <b>CONVERSION_EXIT_SDURA_OUTPUT</b>.
    A conversion routine can also be triggered by specifying its five-place name in the attributes of a field in the Screen Painter or with the addition <b>USING EDIT MASK <Name of conversion routine></b> in the WRITE command in the program. With the USING NO EDIT MASK addition in the WRITE statement, you can skip a conversion routine defined for a domain when outputting.
    Parameters
    The two function modules of a conversion routine must have precisely two parameters with the names INPUT and OUTPUT for the value to be converted and the converted value.
    The INPUT parameter in the INPUT conversion and the OUTPUT parameter in the OUTPUT conversion should not have any reference fields because the value passed in the call could have a different length than that expected.
    Programming Conversion Routines
    ABAP statements that result in an interruption of processing (such as CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT, COMMIT WORK, ROLLBACK WORK, MESSAGE I, MESSAGE W) are not allowed in conversion routines.
    Only A messages are meaningful in output conversion, but A, E and S messages can be triggered in input conversion (although S messages are not very meaningful here). E messages result in an error dialog. Exceptions are not intercepted in the call.
    The output conversion is also triggered with WRITE and WRITE TO. The conversion routine may therefore occur very frequently with lists. The output conversion should therefore be programmed as efficiently as possible.
    No external performs should be used in conversion routines. Programs that are called externally use the table work areas of the first calling main program. In conversion routines this can result in errors that cannot be easily analyzed since they are sometimes called at unpredictable times in the program flow.
    <b>Pls refer link which contains code as an example to conversion routine used in abap</b>.
    <a href="http://www.bwexpertonline.com/downloads/source_code.doc">http://www.bwexpertonline.com/downloads/source_code.doc</a>
    Pls reward points.
    Regards,
    Ameet

  • Scaling analog inputs

    This is generic , so I won’t go into the hardware unless necessary, range is simplified 0-20Ma in, 0-20 scale out.
    I am having problems with scaling in Lookout, my input is 0-20Ma, input conversion is done in BCD for a unipolar FS output of 16533.
    My scaling in Lookout is; raw 0-16533 /  eng units 0-20
    The readings are like this;
    Input   -  output
    0Ma.  - 0
    4Ma. – 2.52
    12Ma. – 11.27
    20Ma. – 20
    So I tried converting to BIN  unipolar FS output of 4095
    My scaling in Lookout is raw 0-4095 /  eng units 0-20
    The readings are like this;
    Input   -  output
    0Ma.  - 0
    4Ma. – 1.65
    12Ma. – 12
    20Ma. – 20
    What am I missing?

    Your numbers look quite linear to me, only a few counts off what is expected. The values given scale just fine with my testing. The puzzle is fun but I think it's time for you to share more about your hardware and what driver object you are using. The only hardware I have handy that uses BCD datatypes are automation direct PLCs. Every thing scales just as it should. i.e 2084 BCD =2.52 scaled, 3306 BCD scales to 3.99, likewise 3306 Dec scales to 3.99  and 2084 Dec scales to 2.52.
    When you did your test what where the scaled values at each step?
    %maReadScaled
    000??
    2554135??
    751512405??
    1002016533??

  • U rgent:"i want to know the work of this "conversion routine".

    Hi all,
    In the domain of any field in the  database table there is one option called "conversion routine" just below to "output list".
    i want to know the work of this "conversion routine".
    can any one please tell me the practical use of this with  real time example.
    good points will be rewarded for helpful answer.
    thanks in advance
    Message was edited by:
            tapu abap

    Hi,
    REPORT  ZTEST.
    TYPES: UPC_YS_API_CHASEL_T TYPE STANDARD TABLE OF UPC_YS_API_CHASEL.
    TYPES: UPC_YS_API_CHAPRO_T TYPE STANDARD TABLE OF UPC_YS_API_CHAPRO.
    TYPES: UPC_YS_API_KYFPRO_T TYPE STANDARD TABLE OF UPC_YS_API_KYFPRO.
    CLASS CL_ABAP_CONV_ROUTINE DEFINITION DEFERRED.
    TYPES: BEGIN OF CONVEXIT_LOOKUP_S,
            CONVEXIT TYPE LVC_S_FCAT-CONVEXIT,
            O_CONVEXIT TYPE REF TO CL_ABAP_CONV_ROUTINE,
           END OF CONVEXIT_LOOKUP_S.
    TYPES: CONVEXIT_LOOKUP_T TYPE HASHED TABLE OF CONVEXIT_LOOKUP_S
            WITH UNIQUE KEY CONVEXIT.
    TYPES: FIELDCATALOG_UNIQUE TYPE HASHED TABLE OF LVC_S_FCAT
             WITH UNIQUE KEY FIELDNAME.
    TYPES: BEGIN OF PLAN_AREA_STRUCT_CACHE,
             PLANNING_AREA TYPE UPC_AREA-AREA,
             FIELDCATALOG TYPE LVC_T_FCAT,
             CHARACTERISTICS TYPE ZUPC_YS_API_CHAPRO_T,
             KEYFIGURES TYPE ZUPC_YS_API_KYFPRO_T,
             TRANSACTION_DATA_TABLE TYPE REF TO DATA,
           END OF PLAN_AREA_STRUCT_CACHE.
    TYPES: PLAN_AREA_STRUCT_CACHE_T TYPE SORTED TABLE OF
    PLAN_AREA_STRUCT_CACHE WITH UNIQUE KEY PLANNING_AREA.
    *       CLASS CX_DATE_CONVERSION DEFINITION
    CLASS CX_DATE_CONVERSION DEFINITION INHERITING FROM CX_DYNAMIC_CHECK.
      PUBLIC SECTION.
        DATA: MESSAGE TYPE STRING.
        METHODS CONSTRUCTOR
          IMPORTING MESSAGE TYPE STRING.
    ENDCLASS.                   "CX_DATE_CONVERSION DEFINITION
    *       CLASS CX_DATE_CONVERSION IMPLEMENTATION
    CLASS CX_DATE_CONVERSION IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        SUPER->CONSTRUCTOR( ).
        ME->MESSAGE = MESSAGE.
      ENDMETHOD.                   "CONSTRUCTOR
    ENDCLASS.                   "CX_DATE_CONVERSION IMPLEMENTATION
    *       CLASS CL_ABAP_CONV_ROUTINE DEFINITION
    CLASS CL_ABAP_CONV_ROUTINE DEFINITION.
      PUBLIC SECTION.
        METHODS APPLY_CONV_INPUT
          IMPORTING
            INPUT TYPE ANY
          EXPORTING
            OUTPUT TYPE ANY .
        METHODS APPLY_CONV_OUTPUT
          IMPORTING
            INPUT TYPE ANY
          EXPORTING
            OUTPUT TYPE ANY .
        METHODS GET_CONVEXIT
          RETURNING
            VALUE(CONVEXIT) TYPE CONVEXIT .
        METHODS SET_CONVEXIT
          IMPORTING
            VALUE(CONVEXIT) TYPE CONVEXIT .
        METHODS CONSTRUCTOR
          IMPORTING
            CONVEXIT TYPE CONVEXIT OPTIONAL .
      PRIVATE SECTION.
        DATA CONVEXIT TYPE CONVEXIT .
        METHODS GET_INPUT_CONVERSION_EXIT
          RETURNING
            VALUE(FUNCTION_MODULE_NAME) TYPE STRING .
        METHODS GET_OUTPUT_CONVERSION_EXIT
          RETURNING
            VALUE(FUNCTION_MODULE_NAME) TYPE STRING .
    ENDCLASS.                   "CL_ABAP_CONV_ROUTINE DEFINITION
    *       CLASS CL_ABAP_CONV_ROUTINE IMPLEMENTATION
    CLASS CL_ABAP_CONV_ROUTINE IMPLEMENTATION.
      METHOD APPLY_CONV_INPUT .
        DATA: FUNCT_MOD TYPE STRING.
        IF NOT ME->CONVEXIT IS INITIAL.
    * Only apply conversion routine if it exits
          CALL METHOD ME->GET_INPUT_CONVERSION_EXIT
            RECEIVING
              FUNCTION_MODULE_NAME = FUNCT_MOD.
          CALL FUNCTION FUNCT_MOD
            EXPORTING
              INPUT  = INPUT
            IMPORTING
              OUTPUT = OUTPUT.
        ELSE.
    * Can only hope this works
          OUTPUT = INPUT.
        ENDIF.
      ENDMETHOD.                   "APPLY_CONV_INPUT
      METHOD APPLY_CONV_OUTPUT.
        DATA: FUNCT_MOD TYPE STRING.
        IF NOT ME->CONVEXIT IS INITIAL.
    * Only apply conversion routine if it exits
          CALL METHOD ME->GET_OUTPUT_CONVERSION_EXIT
            RECEIVING
              FUNCTION_MODULE_NAME = FUNCT_MOD.
          CALL FUNCTION FUNCT_MOD
            EXPORTING
              INPUT  = INPUT
            IMPORTING
              OUTPUT = OUTPUT.
        ELSE.
    * Can only hope this works
          OUTPUT = INPUT.
        ENDIF.
      ENDMETHOD.                   "APPLY_CONV_OUTPUT
      METHOD CONSTRUCTOR.
        IF CONVEXIT IS SUPPLIED.
          CALL METHOD ME->SET_CONVEXIT
            EXPORTING
              CONVEXIT = CONVEXIT.
        ENDIF.
      ENDMETHOD.                   "CONSTRUCTOR
      METHOD GET_CONVEXIT.
        CONVEXIT = ME->CONVEXIT.
      ENDMETHOD.                   "GET_CONVEXIT
      METHOD SET_CONVEXIT.
        ME->CONVEXIT = CONVEXIT.
      ENDMETHOD.                   "SET_CONVEXIT
      METHOD GET_INPUT_CONVERSION_EXIT.
    * Generate standard conversion routines for input conversion
    * This is based on standard SAP ABAP help documentation
        CONCATENATE 'CONVERSION_EXIT_' ME->CONVEXIT
          '_INPUT' INTO FUNCTION_MODULE_NAME.
      ENDMETHOD.                   "GET_INPUT_CONVERSION_EXIT
      METHOD GET_OUTPUT_CONVERSION_EXIT.
    * Generate standard conversion routines for output conversion
    * This is based on standard SAP ABAP help documentation
        CONCATENATE 'CONVERSION_EXIT_' ME->CONVEXIT
          '_OUTPUT' INTO FUNCTION_MODULE_NAME.
      ENDMETHOD.                   "GET_OUTPUT_CONVERSION_EXIT
    ENDCLASS.                   "CL_ABAP_CONV_ROUTINE IMPLEMENTATION
    *       CLASS CL_ABAP_CONV_DECIMAL DEFINITION
    CLASS CL_ABAP_CONV_DECIMAL DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA SAP_DECIMAL_FMT_SPACE TYPE USR01-DCPFM VALUE ' '
    READ-ONLY .
        CLASS-DATA SAP_DECIMAL_FMT_X TYPE USR01-DCPFM VALUE 'X' READ-ONLY .
        CLASS-DATA SAP_DECIMAL_FMT_Y TYPE USR01-DCPFM VALUE 'Y' READ-ONLY .
        CLASS-DATA USER_DECIMAL_FORMAT TYPE USR01-DCPFM READ-ONLY .
        CLASS-METHODS CLASS_CONSTRUCTOR .
        CLASS-METHODS CONVERT_DECIMAL_EXT2INT
          IMPORTING
            EXTERNAL_VALUE TYPE STRING
          CHANGING
            INTERNAL_VALUE TYPE P
          RAISING
            CX_SY_CONVERSION_OVERFLOW
            CX_SY_CONVERSION_NO_NUMBER .
        CLASS-METHODS CONVERT_DECIMAL_INT2EXT
          IMPORTING
            INTERNAL_VALUE TYPE P
          CHANGING
            EXTERNAL_VALUE TYPE STRING .
    ENDCLASS.                   "CL_ABAP_CONV_DECIMAL DEFINITION
    *       CLASS CL_ABAP_CONV_DECIMAL IMPLEMENTATION
    CLASS CL_ABAP_CONV_DECIMAL IMPLEMENTATION.
      METHOD CLASS_CONSTRUCTOR .
        SELECT SINGLE DCPFM FROM USR01 INTO USER_DECIMAL_FORMAT
          WHERE BNAME = SY-UNAME.
      ENDMETHOD.                   "CLASS_CONSTRUCTOR
      METHOD CONVERT_DECIMAL_EXT2INT .
    * THE GOAL IS TO GET THIS INTO INTERNAL FORMAT WHICH IS EQUIVALENT TO
    * EX. NNNNN.NN
        DATA: NUM_STR TYPE STRING.
        NUM_STR = EXTERNAL_VALUE.
        CONDENSE NUM_STR NO-GAPS.
        CASE USER_DECIMAL_FORMAT.
          WHEN SAP_DECIMAL_FMT_X.
            REPLACE ALL OCCURRENCES OF ',' IN NUM_STR WITH SPACE.
            CONDENSE NUM_STR NO-GAPS.
          WHEN SAP_DECIMAL_FMT_SPACE.
            REPLACE ALL OCCURRENCES OF '.' IN NUM_STR WITH SPACE.
            CONDENSE NUM_STR NO-GAPS.
            REPLACE ALL OCCURRENCES OF ',' IN NUM_STR WITH '.'.
          WHEN SAP_DECIMAL_FMT_Y.
            REPLACE ALL OCCURRENCES OF ',' IN NUM_STR WITH '.'.
        ENDCASE.
        INTERNAL_VALUE = NUM_STR.
      ENDMETHOD.                   "CONVERT_DECIMAL_EXT2INT
      METHOD CONVERT_DECIMAL_INT2EXT .
    * THE GOAL IS TO GET THIS INTO EXTERNAL FORMAT WHICH IS BASED ON SAP
    * USER PROFILE SETTINGS
    * CURRENT INPUT FORMAT EQUIVALENT IS EX. NNNNN.NN
        DATA: TEMP(70) TYPE C.
        WRITE INTERNAL_VALUE TO TEMP.
        EXTERNAL_VALUE = TEMP.
      ENDMETHOD.                   "CONVERT_DECIMAL_INT2EXT
    ENDCLASS.                   "CL_ABAP_CONV_DECIMAL IMPLEMENTATION
    *       CLASS CL_ABAP_CONV_DATE DEFINITION
    CLASS CL_ABAP_CONV_DATE DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA SAP_DATE_FMT_5 TYPE USR01-DATFM VALUE '5' READ-ONLY .
        CLASS-DATA SAP_DATE_FMT_6 TYPE USR01-DATFM VALUE '6' READ-ONLY .
        CLASS-DATA SAP_DATE_FMT_3 TYPE USR01-DATFM VALUE '3' READ-ONLY .
        CLASS-DATA SAP_DATE_FMT_4 TYPE USR01-DATFM VALUE '4' READ-ONLY .
        CLASS-DATA SAP_DATE_FMT_1 TYPE USR01-DATFM VALUE '1' READ-ONLY .
        CLASS-DATA SAP_DATE_FMT_2 TYPE USR01-DATFM VALUE '2' READ-ONLY .
        CLASS-DATA USER_DATE_FORMAT TYPE USR01-DATFM READ-ONLY .
        CLASS-METHODS CONVERT_DATE_EXT2INT
          IMPORTING
            EXTERNAL_DATE TYPE STRING
          RETURNING
            VALUE(INTERNAL_DATE) TYPE D
          RAISING
            CX_DATE_CONVERSION .
        CLASS-METHODS CONVERT_DATE_INT2EXT
          IMPORTING
            INTERNAL_DATE TYPE D
          RETURNING
            VALUE(EXTERNAL_DATE) TYPE STRING .
        CLASS-METHODS CLASS_CONSTRUCTOR .
    ENDCLASS.                   "CL_ABAP_CONV_DATE DEFINITION
    *       CLASS CL_ABAP_CONV_DATE IMPLEMENTATION
    CLASS CL_ABAP_CONV_DATE IMPLEMENTATION.
      METHOD CLASS_CONSTRUCTOR.
        SELECT SINGLE DATFM FROM USR01 INTO USER_DATE_FORMAT
          WHERE BNAME = SY-UNAME.
      ENDMETHOD.                   "CLASS_CONSTRUCTOR
      METHOD CONVERT_DATE_EXT2INT.
    *  HERE ARE THE CURRENT DATE FORMATS FROM SAP GUI
    *1 DD.MM.YYYY
    *2 MM/DD/YYYY
    *3 MM-DD-YYYY
    *4 YYYY.MM.DD
    *5 YYYY/MM/DD
    *6 YYYY-MM-DD
        DATA: PERMITTED_NUMBERS TYPE STRING VALUE '0123456789'.
        DATA: TEMP_DATE TYPE D.
        DATA: MESSAGE_VALID_NUMERICS TYPE STRING
          VALUE 'Only Numerics (0-9) are acceptable.'.
        DATA: MESSAGE_VALID_FORMAT TYPE STRING
          VALUE 'Invalid date format.'.
        IF STRLEN( EXTERNAL_DATE ) = 10.
          CASE USER_DATE_FORMAT.
            WHEN SAP_DATE_FMT_1.
              IF EXTERNAL_DATE+2(1) = '.' AND EXTERNAL_DATE+5(1) = '.'.
                TEMP_DATE+0(4) = EXTERNAL_DATE+6(4). " YEAR
                TEMP_DATE+4(2) = EXTERNAL_DATE+3(2). " MONTH
                TEMP_DATE+6(2) = EXTERNAL_DATE+0(2). " DAY
                IF NOT ( TEMP_DATE CO PERMITTED_NUMBERS ).
                  RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_NUMERICS." ISSUE ERROR
                ENDIF.
              ELSE.
                RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_FORMAT. " ISSUE ERROR
              ENDIF.
            WHEN SAP_DATE_FMT_2.
              IF EXTERNAL_DATE+2(1) = '/' AND EXTERNAL_DATE+5(1) = '/'.
                TEMP_DATE+0(4) = EXTERNAL_DATE+6(4). " YEAR
                TEMP_DATE+4(2) = EXTERNAL_DATE+0(2). " MONTH
                TEMP_DATE+6(2) = EXTERNAL_DATE+3(2). " DAY
                IF NOT ( TEMP_DATE CO PERMITTED_NUMBERS ).
                  RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_NUMERICS. " ISSUE
                ENDIF.
              ELSE.
                RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_FORMAT. " ISSUE ERROR
              ENDIF.
            WHEN SAP_DATE_FMT_3.
              IF EXTERNAL_DATE+2(1) = '-' AND EXTERNAL_DATE+5(1) = '-'.
                TEMP_DATE+0(4) = EXTERNAL_DATE+6(4). " YEAR
                TEMP_DATE+4(2) = EXTERNAL_DATE+0(2). " MONTH
                TEMP_DATE+6(2) = EXTERNAL_DATE+3(2). " DAY
                IF NOT ( TEMP_DATE CO PERMITTED_NUMBERS ).
                  RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_NUMERICS." ISSUE ERROR
                ENDIF.
              ELSE.
                RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_FORMAT. " ISSUE ERROR
              ENDIF.
            WHEN SAP_DATE_FMT_4.
              IF EXTERNAL_DATE+4(1) = '.' AND EXTERNAL_DATE+7(1) = '.'.
                TEMP_DATE+0(4) = EXTERNAL_DATE+0(4). " YEAR
                TEMP_DATE+4(2) = EXTERNAL_DATE+5(2). " MONTH
                TEMP_DATE+6(2) = EXTERNAL_DATE+8(2). " DAY
                IF NOT ( TEMP_DATE CO PERMITTED_NUMBERS ).
                  RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_NUMERICS." ISSUE ERROR
                ENDIF.
              ELSE.
                RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_FORMAT. " ISSUE ERROR
              ENDIF.
            WHEN SAP_DATE_FMT_5.
              IF EXTERNAL_DATE+4(1) = '/' AND EXTERNAL_DATE+7(1) = '/'.
                TEMP_DATE+0(4) = EXTERNAL_DATE+0(4). " YEAR
                TEMP_DATE+4(2) = EXTERNAL_DATE+5(2). " MONTH
                TEMP_DATE+6(2) = EXTERNAL_DATE+8(2). " DAY
                IF NOT ( TEMP_DATE CO PERMITTED_NUMBERS ).
                  RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_NUMERICS." ISSUE ERROR
                ENDIF.
              ELSE.
                RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_FORMAT. " ISSUE ERROR
              ENDIF.
            WHEN SAP_DATE_FMT_6.
              IF EXTERNAL_DATE+4(1) = '-' AND EXTERNAL_DATE+7(1) = '-'.
                TEMP_DATE+0(4) = EXTERNAL_DATE+0(4). " YEAR
                TEMP_DATE+4(2) = EXTERNAL_DATE+5(2). " MONTH
                TEMP_DATE+6(2) = EXTERNAL_DATE+8(2). " DAY
                IF NOT ( TEMP_DATE CO PERMITTED_NUMBERS ).
                  RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_NUMERICS." ISSUE ERROR
                ENDIF.
              ELSE.
                RAISE EXCEPTION TYPE CX_DATE_CONVERSION
                    EXPORTING MESSAGE = MESSAGE_VALID_FORMAT. " ISSUE ERROR
              ENDIF.
          ENDCASE.
          INTERNAL_DATE = TEMP_DATE.
        ELSEIF STRLEN( EXTERNAL_DATE ) = 8.
    * ASSUME NORMAL DATE FORMAT (YYYYMMDD)
          INTERNAL_DATE = EXTERNAL_DATE.
        ELSE.
          RAISE EXCEPTION TYPE CX_DATE_CONVERSION
            EXPORTING MESSAGE = MESSAGE_VALID_FORMAT. " ISSUE ERROR
        ENDIF.
      ENDMETHOD.                   "CONVERT_DATE_EXT2INT
      METHOD CONVERT_DATE_INT2EXT.
    *  HERE ARE THE CURRENT DATE FORMATS FROM SAP GUI
    *1     DD.MM.YYYY
    *2     MM/DD/YYYY
    *3     MM-DD-YYYY
    *4     YYYY.MM.DD
    *5     YYYY/MM/DD
    *6     YYYY-MM-DD
        DATA: EXTERNAL_DATE_TEMP(10) TYPE C.
        WRITE INTERNAL_DATE TO EXTERNAL_DATE_TEMP.
        EXTERNAL_DATE = EXTERNAL_DATE_TEMP.
      ENDMETHOD.                   "CONVERT_DATE_INT2EXT
    ENDCLASS.                   "CL_ABAP_CONV_DATE IMPLEMENTATION
    *       CLASS CX_SEM_BPS_DATA_ACCESS DEFINITION
    CLASS CX_SEM_BPS_DATA_ACCESS DEFINITION INHERITING FROM CX_DYNAMIC_CHECK
      PUBLIC SECTION.
        DATA: MESSAGE TYPE STRING.
        DATA: RETURN_T TYPE BAPIRET2_T.
        METHODS CONSTRUCTOR
          IMPORTING
            MESSAGE TYPE STRING
            RETURN_T TYPE BAPIRET2_T OPTIONAL.
    ENDCLASS.                   "CX_SEM_BPS_DATA_ACCESS DEFINITION
    *       CLASS CX_SEM_BPS_DATA_ACCESS IMPLEMENTATION
    CLASS CX_SEM_BPS_DATA_ACCESS IMPLEMENTATION.
      METHOD CONSTRUCTOR.
        SUPER->CONSTRUCTOR( ).
        ME->MESSAGE = MESSAGE.
        ME->RETURN_T = RETURN_T.
      ENDMETHOD.                   "CONSTRUCTOR
    ENDCLASS.                   "CX_SEM_BPS_DATA_ACCESS IMPLEMENTATION
    *       CLASS CL_SEMBPS_DATA_ACCESSOR DEFINITION
    CLASS CL_SEMBPS_DATA_ACCESSOR DEFINITION.
      PUBLIC SECTION.
        DATA TRANSACTION_DATA TYPE REF TO DATA .
        CLASS-DATA C_LEVEL TYPE UPC_PLEVEL-PLEVEL VALUE 'ZLABAP' READ-ONLY .
        CLASS-DATA C_LAYOUT TYPE UPP_PARAM-PARAM VALUE 'ZMABAP' READ-ONLY .
        CLASS-DATA C_ADHOC_PACK TYPE UPC_PACKAGE-PPACKAGE VALUE '0-ADHOC'
    READ-ONLY .
        CLASS-DATA C_MULTIPLAN_AREA TYPE UPC_YS_API_CHAPRO-CHANM VALUE
    '_AREA_____' READ-ONLY .
        METHODS GET_INFOCUBE
          RETURNING
            VALUE(INFOCUBE) TYPE UPC_BW_AREA-INFOCUBE .
        METHODS GET_CHARACTERISTIC_SELECTIONS
          EXPORTING
            CHARACTERISTIC_SELECTION TYPE UPC_YS_API_CHASEL_T .
        METHODS REFRESH
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        METHODS CONSTRUCTOR
          IMPORTING
            PLANNING_AREA TYPE UPC_AREA-AREA
            IT_FIELDCATALOG TYPE LVC_T_FCAT
            TRANSACTION_DATA_TABLE TYPE REF TO DATA
            CHARACTERISTIC_SELECTION TYPE UPC_YS_API_CHASEL_T
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        METHODS GET_PLANNING_AREA
          RETURNING
            VALUE(PLANNING_AREA) TYPE UPC_AREA-AREA .
        METHODS GET_CHARACTERISTICS
          EXPORTING
            CHARACTERISTICS TYPE UPC_YS_API_CHAPRO_T .
        METHODS GET_KEYFIGURES
          EXPORTING
            KEYFIGURES TYPE UPC_YS_API_KYFPRO_T .
        METHODS SAVE
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
      PRIVATE SECTION.
        DATA CONVEXIT_LOOKUP TYPE CONVEXIT_LOOKUP_T .
        DATA INFOCUBE TYPE UPC_BW_AREA-INFOCUBE .
        DATA IT_FIELDCATALOG TYPE FIELDCATALOG_UNIQUE .
        DATA PLANNING_AREA TYPE UPC_AREA-AREA .
        DATA CHARACTERISTICS TYPE UPC_YS_API_CHAPRO_T .
        DATA KEYFIGURES TYPE UPC_YS_API_KYFPRO_T .
        DATA CHARACTERISTIC_SELECTION TYPE UPC_YS_API_CHASEL_T .
        DATA LAYOUT_COL_SPEC TYPE STANDARD TABLE OF UPC_YS_API_COL .
        CLASS-METHODS FORCE_ERROR_MESSAGE
          IMPORTING
            MESSAGE TYPE STRING OPTIONAL
            RETURN_STRUCT TYPE BAPIRET2 OPTIONAL
            RETURN_STRUCTS TYPE BAPIRET2_T OPTIONAL
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        CLASS-METHODS CHECK_MESSAGE
          IMPORTING
            E_SUBRC TYPE SY-SUBRC
            RETURN_STRUCT TYPE BAPIRET2
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        METHODS SET_CHARACTERISTIC_SELECTION
          IMPORTING
            CHARACTERISTIC_SELECTION TYPE UPC_YS_API_CHASEL_T .
        METHODS SET_PLANNING_AREA
          IMPORTING
            PLANNING_AREA TYPE UPC_AREA-AREA
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        METHODS VALIDATE_PLANNING_OBJECTS
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        CLASS-METHODS CHECK_MESSAGES
          IMPORTING
            RETURN_STRUCTS TYPE BAPIRET2_T
            E_SUBRC TYPE SY-SUBRC
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        METHODS READ_DATA
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
    ENDCLASS.                   "CL_SEMBPS_DATA_ACCESSOR DEFINITION
    *       CLASS CL_SEMBPS_DATA_ACCESSOR IMPLEMENTATION
    CLASS CL_SEMBPS_DATA_ACCESSOR IMPLEMENTATION.
      METHOD CONSTRUCTOR .
        DATA: WA_FIELDCATALOG TYPE LVC_S_FCAT.
        DATA: CONVEXIT_WA TYPE CONVEXIT_LOOKUP_S.
    * BUILD CONVERSION EXITS AND FIELDCATALOG
        LOOP AT IT_FIELDCATALOG INTO WA_FIELDCATALOG.
          INSERT WA_FIELDCATALOG INTO TABLE ME->IT_FIELDCATALOG[].
          IF NOT WA_FIELDCATALOG-CONVEXIT IS INITIAL.
            CLEAR CONVEXIT_WA.
            CONVEXIT_WA-CONVEXIT = WA_FIELDCATALOG-CONVEXIT.
            CREATE OBJECT CONVEXIT_WA-O_CONVEXIT
                EXPORTING
                  CONVEXIT = WA_FIELDCATALOG-CONVEXIT.
            INSERT CONVEXIT_WA INTO TABLE ME->CONVEXIT_LOOKUP.
          ENDIF.
        ENDLOOP.
        CALL METHOD ME->SET_PLANNING_AREA
          EXPORTING
            PLANNING_AREA = PLANNING_AREA.
        CALL METHOD ME->SET_CHARACTERISTIC_SELECTION
          EXPORTING
            CHARACTERISTIC_SELECTION = CHARACTERISTIC_SELECTION.
    * POINT TO TABLE CONTAINING TRANSACTION DATA
        ME->TRANSACTION_DATA = TRANSACTION_DATA_TABLE.
    * READ DATA
        CALL METHOD ME->REFRESH.
      ENDMETHOD.                   "CONSTRUCTOR
      METHOD GET_CHARACTERISTICS .
        CHARACTERISTICS[] = ME->CHARACTERISTICS[].
      ENDMETHOD.                   "GET_CHARACTERISTICS
      METHOD GET_CHARACTERISTIC_SELECTIONS.
        CHARACTERISTIC_SELECTION[] = ME->CHARACTERISTIC_SELECTION[].
      ENDMETHOD.                   "GET_CHARACTERISTIC_SELECTIONS
      METHOD GET_INFOCUBE .
        INFOCUBE = ME->INFOCUBE.
      ENDMETHOD.                   "GET_INFOCUBE
      METHOD GET_KEYFIGURES .
        KEYFIGURES[] = ME->KEYFIGURES[].
      ENDMETHOD.                   "GET_KEYFIGURES
      METHOD GET_PLANNING_AREA .
        PLANNING_AREA = ME->PLANNING_AREA.
      ENDMETHOD.                   "GET_PLANNING_AREA
      METHOD REFRESH.
        CALL METHOD ME->READ_DATA.
      ENDMETHOD.                   "REFRESH
      METHOD SAVE .
        DATA: E_SUBRC TYPE SY-SUBRC.
        DATA: ES_RETURN TYPE BAPIRET2.
        DATA: CHARACTERISTICS_WA TYPE UPC_YS_API_CHAPRO.
        DATA: WA_REF TYPE REF TO DATA.
        DATA: ITK_ROW TYPE TABLE OF UPC_YS_API_ROW.
        DATA: ITK_ROW_WA TYPE UPC_YS_API_ROW.
        DATA: LAYOUT_COL_SPEC_WA TYPE UPC_YS_API_COL.
        DATA: ITK_DATA TYPE TABLE OF UPC_YS_API_DATA.
        DATA: ITK_DATA_WA TYPE UPC_YS_API_DATA.
        DATA: ETK_RETURN TYPE TABLE OF BAPIRET2.
        DATA: WA_FIELDCATALOG TYPE LVC_S_FCAT.
        DATA: CONVERSION_EXIT TYPE STRING.
        DATA: KEYFIG TYPE STRING.
        DATA: DATE_CHAR TYPE STRING.
        DATA: MESSAGE TYPE STRING.
        CONSTANTS: FIND_FIELD_ERR TYPE STRING VALUE 'Unable to find field'.
        FIELD-SYMBOLS: <TD_FIELD> TYPE ANY.
        FIELD-SYMBOLS: <TD_WA> TYPE ANY.
        FIELD-SYMBOLS: <TD_TAB> TYPE STANDARD TABLE.
        ASSIGN ME->TRANSACTION_DATA->* TO <TD_TAB>.
        CREATE DATA WA_REF LIKE LINE OF <TD_TAB>.
        ASSIGN WA_REF->* TO <TD_WA>.
        CLEAR <TD_WA>.
        DATA: ROWC TYPE I.
        ROWC = 1.
        LOOP AT <TD_TAB> INTO <TD_WA>.
    * FILL CHARACTERISTIC DATA
          LOOP AT ME->CHARACTERISTICS INTO CHARACTERISTICS_WA.
            ASSIGN COMPONENT CHARACTERISTICS_WA-CHANM OF STRUCTURE <TD_WA>
              TO <TD_FIELD>.
            IF SY-SUBRC = 0.
              ITK_ROW_WA-ROW = ROWC.
              ITK_ROW_WA-CHANM = CHARACTERISTICS_WA-CHANM.
              CLEAR ITK_ROW_WA-CHAVLEXT.
    * APPLY OUTPUT CONVERSION EXIT FOR SAP EXTERNAL TYPE
    * ONLY APPLIES WHEN VALUE IS NOT UNASSIGNED ('#') MEANING INITIAL(ABAP)
    * FOR EXTERNAL CONVERSION UNASSIGED ('#') IS JUST A BLANK
              IF NOT <TD_FIELD> IS INITIAL.
                READ TABLE ME->IT_FIELDCATALOG INTO WA_FIELDCATALOG
                  WITH TABLE KEY FIELDNAME = ITK_ROW_WA-CHANM.
                IF SY-SUBRC = 0 AND NOT WA_FIELDCATALOG-CONVEXIT IS INITIAL.
                  DATA: CONVEXIT_WA TYPE CONVEXIT_LOOKUP_S.
                  READ TABLE ME->CONVEXIT_LOOKUP INTO CONVEXIT_WA
                    WITH TABLE KEY CONVEXIT = WA_FIELDCATALOG-CONVEXIT.
                  CALL METHOD CONVEXIT_WA-O_CONVEXIT->APPLY_CONV_OUTPUT
                    EXPORTING
                      INPUT  = <TD_FIELD>
                    IMPORTING
                      OUTPUT = <TD_FIELD>.
                  ITK_ROW_WA-CHAVLEXT = <TD_FIELD>.
                ELSEIF SY-SUBRC = 0 AND WA_FIELDCATALOG-INTTYPE = 'D'.
    * APPLY DATE CONVERSION TO EXTERNAL FORMAT BASED ON USER PROFILE
                  CALL METHOD CL_ABAP_CONV_DATE=>CONVERT_DATE_INT2EXT
                    EXPORTING
                      INTERNAL_DATE = <TD_FIELD>
                    RECEIVING
                      EXTERNAL_DATE = DATE_CHAR.
                  ITK_ROW_WA-CHAVLEXT = DATE_CHAR.
                ELSE.
                  ITK_ROW_WA-CHAVLEXT = <TD_FIELD>.
                ENDIF.
              ENDIF.
              APPEND ITK_ROW_WA TO ITK_ROW.
            ELSE.
    * FAILURE TO FIND THE FIELD IN THE POINTER WILL RESULT IN
    * TRANSACTION DATA INTEGRITY ISSUES, WE SHOULD ERROR OUT
              CONCATENATE FIND_FIELD_ERR CHARACTERISTICS_WA-CHANM
            INTO MESSAGE.
              CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>FORCE_ERROR_MESSAGE
                EXPORTING
                  MESSAGE = MESSAGE.
            ENDIF.
          ENDLOOP.
    * FILL KEY FIGURE DATA
          LOOP AT ME->LAYOUT_COL_SPEC INTO LAYOUT_COL_SPEC_WA.
            ASSIGN COMPONENT LAYOUT_COL_SPEC_WA-CHAVLEXT
              OF STRUCTURE <TD_WA> TO <TD_FIELD>.
            IF SY-SUBRC = 0.
              ITK_DATA_WA-ROW = ROWC.
              ITK_DATA_WA-COL = LAYOUT_COL_SPEC_WA-COL.
              READ TABLE ME->IT_FIELDCATALOG INTO WA_FIELDCATALOG
                WITH TABLE KEY FIELDNAME = LAYOUT_COL_SPEC_WA-CHAVLEXT.
              IF WA_FIELDCATALOG-INTTYPE = 'P'.
    * MUST CONVERT TO EXTERNAL FORMAT FOR DECIMALS
                CALL METHOD CL_ABAP_CONV_DECIMAL=>CONVERT_DECIMAL_INT2EXT
                  EXPORTING
                    INTERNAL_VALUE = <TD_FIELD>
                  CHANGING
                    EXTERNAL_VALUE = KEYFIG.
              ELSEIF WA_FIELDCATALOG-INTTYPE = 'F'
                OR WA_FIELDCATALOG-INTTYPE = 'I'.
                KEYFIG = <TD_FIELD>.
              ENDIF.
              ITK_DATA_WA-VALUE = KEYFIG.
              APPEND ITK_DATA_WA TO ITK_DATA.
            ELSE.
    * FAILURE TO FIND THE FIELD IN THE POINTER WILL RESULT IN
    * TRANSACTION DATA INTEGRITY ISSUES, WE SHOULD ERROR OUT
              CONCATENATE FIND_FIELD_ERR LAYOUT_COL_SPEC_WA-CHAVLEXT
                INTO MESSAGE.
              CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>FORCE_ERROR_MESSAGE
                EXPORTING
                  MESSAGE = MESSAGE.
            ENDIF.
          ENDLOOP.
          ROWC = ROWC + 1.
        ENDLOOP.
    * SET ADHOC PACKAGE SELECTIONS
        CALL FUNCTION 'API_SEMBPS_ADHOCPACKAGE_SET'
          EXPORTING
            I_AREA     = ME->PLANNING_AREA
            I_PLEVEL   = CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
          IMPORTING
            E_SUBRC    = E_SUBRC
            ES_RETURN  = ES_RETURN
          TABLES
            ITK_CHASEL = CHARACTERISTIC_SELECTION.
    * THROW EXCEPTIONS IF NECESSARY
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
          EXPORTING
            E_SUBRC       = E_SUBRC
            RETURN_STRUCT = ES_RETURN.
        CALL FUNCTION 'API_SEMBPS_SETDATA'
          EXPORTING
            I_AREA     = ME->PLANNING_AREA
            I_PLEVEL   = CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
            I_PACKAGE  = CL_SEMBPS_DATA_ACCESSOR=>C_ADHOC_PACK
            I_LAYOUT   = CL_SEMBPS_DATA_ACCESSOR=>C_LAYOUT
          IMPORTING
            E_SUBRC    = E_SUBRC
          TABLES
            ITK_ROW    = ITK_ROW
            ITK_DATA   = ITK_DATA
            ETK_RETURN = ETK_RETURN.
    * THROW EXCEPTIONS IF NECESSARY
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGES
          EXPORTING
            E_SUBRC        = E_SUBRC
            RETURN_STRUCTS = ETK_RETURN.
    * SAVE THE DATA INTO THE CUBE
        CALL FUNCTION 'API_SEMBPS_POST'
          IMPORTING
            E_SUBRC   = E_SUBRC
            ES_RETURN = ES_RETURN.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
          EXPORTING
            E_SUBRC       = E_SUBRC
            RETURN_STRUCT = ES_RETURN.
    * CLEAR SEM BPS DATA BUFFER AS WEIRD BEHAVIOR MAY OCCUR IF
    * NOT CLEARED WHETHER IF SUCCESSFUL OR NOT
        CALL FUNCTION 'API_SEMBPS_REFRESH'
          IMPORTING
            E_SUBRC   = E_SUBRC
            ES_RETURN = ES_RETURN.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
          EXPORTING
            E_SUBRC       = E_SUBRC
            RETURN_STRUCT = ES_RETURN.
      ENDMETHOD.                   "SAVE
      METHOD CHECK_MESSAGE .
        DATA: RETURN_T TYPE BAPIRET2_T.
        APPEND RETURN_STRUCT TO RETURN_T.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGES
          EXPORTING
            RETURN_STRUCTS = RETURN_T
            E_SUBRC        = E_SUBRC.
      ENDMETHOD.                   "CHECK_MESSAGE
      METHOD CHECK_MESSAGES .
        IF E_SUBRC <> 0.
          DATA: MESSAGE TYPE STRING.
          DATA: RETURN TYPE BAPIRET2.
          READ TABLE RETURN_STRUCTS INTO RETURN WITH KEY TYPE = 'E'.
          IF SY-SUBRC <> 0.
            READ TABLE RETURN_STRUCTS INTO RETURN WITH KEY TYPE = 'A'.
          ENDIF.
          MESSAGE = RETURN-MESSAGE.
          RAISE EXCEPTION TYPE CX_SEM_BPS_DATA_ACCESS
            EXPORTING
              MESSAGE = MESSAGE
              RETURN_T = RETURN_STRUCTS.
        ENDIF.
      ENDMETHOD.                   "CHECK_MESSAGES
      METHOD FORCE_ERROR_MESSAGE.
        DATA: RC TYPE SY-SUBRC VALUE 4.
        IF MESSAGE IS SUPPLIED.
          DATA: RETURN TYPE BAPIRET2.
          RETURN-TYPE = 'E'.
          RETURN-MESSAGE = MESSAGE.
          CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
            EXPORTING
              RETURN_STRUCT = RETURN
              E_SUBRC       = RC.
        ENDIF.
        IF RETURN_STRUCT IS SUPPLIED.
          CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
            EXPORTING
              RETURN_STRUCT = RETURN_STRUCT
              E_SUBRC       = RC.
        ENDIF.
        IF RETURN_STRUCTS IS SUPPLIED.
          CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGES
            EXPORTING
              RETURN_STRUCTS = RETURN_STRUCTS
              E_SUBRC        = RC.
        ENDIF.
      ENDMETHOD.                   "FORCE_ERROR_MESSAGE
      METHOD READ_DATA .
        DATA: CHAR_DATA TYPE TABLE OF UPC_YS_API_ROW.
        DATA: KEYFIG_DATA TYPE TABLE OF UPC_YS_API_DATA.
        DATA: ETK_ROW_WA TYPE UPC_YS_API_ROW.
        DATA: ETK_COL TYPE TABLE OF UPC_YS_API_COL.
        DATA: ETK_RETURN TYPE TABLE OF BAPIRET2.
        DATA: KEYFIGURES_WA TYPE UPC_YS_API_KYFPRO.
        DATA: E_SUBRC TYPE SY-SUBRC.
        DATA: ES_RETURN TYPE BAPIRET2.
        DATA: ETK_COL_WA TYPE UPC_YS_API_COL.
        DATA: WA_REF TYPE REF TO DATA.
        DATA: HAS_DATA TYPE BOOLEAN.
        DATA: KEYFIG_DATA_WA TYPE UPC_YS_API_DATA.
        DATA: LINE1 TYPE I.
        DATA: LINE2 TYPE I.
        DATA: MESSAGE TYPE STRING.
        CONSTANTS: FIND_FIELD_ERR TYPE STRING VALUE 'Unable to find field '.
        FIELD-SYMBOLS: <TD_FIELD> TYPE ANY.
        FIELD-SYMBOLS: <TD_WA> TYPE ANY.
        FIELD-SYMBOLS: <TD_TAB> TYPE STANDARD TABLE.
        CALL FUNCTION 'API_SEMBPS_ADHOCPACKAGE_SET'
          EXPORTING
            I_AREA     = ME->PLANNING_AREA
            I_PLEVEL   = CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
          IMPORTING
            E_SUBRC    = E_SUBRC
            ES_RETURN  = ES_RETURN
          TABLES
            ITK_CHASEL = ME->CHARACTERISTIC_SELECTION.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
          EXPORTING
            E_SUBRC       = E_SUBRC
            RETURN_STRUCT = ES_RETURN.
        CALL FUNCTION 'API_SEMBPS_GETDATA'
          EXPORTING
            I_AREA      = ME->PLANNING_AREA
            I_PLEVEL    = CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
            I_PACKAGE   = CL_SEMBPS_DATA_ACCESSOR=>C_ADHOC_PACK
            I_LAYOUT    = CL_SEMBPS_DATA_ACCESSOR=>C_LAYOUT
            I_READ_ONLY = 'X'
          IMPORTING
            E_SUBRC     = E_SUBRC
          TABLES
            ETK_ROW     = CHAR_DATA
            ETK_COL     = ETK_COL
            ETK_DATA    = KEYFIG_DATA
            ETK_RETURN  = ETK_RETURN.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGES
          EXPORTING
            E_SUBRC        = E_SUBRC
            RETURN_STRUCTS = ETK_RETURN.
    * SET LAYOUT COLUMN SPECIFICATION
        ME->LAYOUT_COL_SPEC[] = ETK_COL[].
    * CHECK TO SEE IF THE COLUMN SPEC CONTAINS ALL KEY FIGURES REQUIRED
    * THIS WOULD GUARANTEE THAT ALL THE KEY FIGURES PRESENT IN THE CUBE
    * ARE ALSO IN THE LAYOUT
        DESCRIBE TABLE ME->KEYFIGURES LINES LINE1.
        DESCRIBE TABLE ME->LAYOUT_COL_SPEC LINES LINE2.
        IF LINE1 <> LINE2.
          LOOP AT ME->KEYFIGURES INTO KEYFIGURES_WA.
            READ TABLE ME->LAYOUT_COL_SPEC
              WITH KEY CHAVLEXT = KEYFIGURES_WA-KYFNM
              TRANSPORTING NO FIELDS.
            IF SY-SUBRC <> 0.
              CLEAR ES_RETURN.
              ES_RETURN-TYPE = 4.
              CONCATENATE 'Layout ' CL_SEMBPS_DATA_ACCESSOR=>C_LAYOUT
                ' is missing keyfigure: ' KEYFIGURES_WA-KYFNM
                INTO ES_RETURN-MESSAGE.
              APPEND ES_RETURN TO ETK_RETURN.
            ENDIF.
          ENDLOOP.
          CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>FORCE_ERROR_MESSAGE
            EXPORTING
              RETURN_STRUCTS = ETK_RETURN.
        ENDIF.
    * CLEAR TRANSACTION DATA IF ANY
        ASSIGN TRANSACTION_DATA->* TO <TD_TAB>.
        REFRESH <TD_TAB>.
        CREATE DATA WA_REF LIKE LINE OF <TD_TAB>.
        ASSIGN WA_REF->* TO <TD_WA>.
        DATA: PREV_ROWID TYPE UPC_YS_API_ROW-ROW VALUE 1.
        DATA: WA_FIELDCATALOG TYPE LVC_S_FCAT.
        DATA: CONVERSION_EXIT TYPE STRING.
        DATA: DECIMAL_CONV TYPE STRING.
        DATA: DATE_CONV TYPE STRING.
        CLEAR <TD_WA>.
    * SORT DATA
        SORT KEYFIG_DATA BY ROW.
        SORT ETK_COL BY COL.
        SORT CHAR_DATA BY ROW.
    * INSERT ALL CHARACTERISTIC ROWS
        LOOP AT CHAR_DATA INTO ETK_ROW_WA.
          IF ETK_ROW_WA-CHANM IS NOT INITIAL.
            IF ETK_ROW_WA-ROW <> PREV_ROWID.
              CLEAR HAS_DATA.
              PREV_ROWID = ETK_ROW_WA-ROW.
              APPEND <TD_WA> TO <TD_TAB>.
              CLEAR <TD_WA>.
            ENDIF.
            HAS_DATA = 'X'.
            ASSIGN COMPONENT ETK_ROW_WA-CHANM OF STRUCTURE
              <TD_WA> TO <TD_FIELD>.
            IF SY-SUBRC = 0.
              CLEAR <TD_FIELD>.
              IF ETK_ROW_WA-CHAVLEXT <> '#'.
    * APPLY INPUT CONVERSION EXIT FOR SAP INTERNAL DATA ELEMENTS
    * ONLY APPLIES WHEN VALUE IS NOT UNASSIGNED ('#')
                READ TABLE ME->IT_FIELDCATALOG INTO WA_FIELDCATALOG
                  WITH TABLE KEY FIELDNAME = ETK_ROW_WA-CHANM.
                IF SY-SUBRC = 0 AND NOT WA_FIELDCATALOG-CONVEXIT IS INITIAL.
                  <TD_FIELD> = ETK_ROW_WA-CHAVLEXT.
    * APPLY INPUT CONVERSION EXIT IF ANY, CHECK INFOOBJECT RSD1 TRANSACTION
                  DATA: CONVEXIT_WA TYPE CONVEXIT_LOOKUP_S.
                  READ TABLE ME->CONVEXIT_LOOKUP INTO CONVEXIT_WA
                    WITH TABLE KEY CONVEXIT = WA_FIELDCATALOG-CONVEXIT.
                  CALL METHOD CONVEXIT_WA-O_CONVEXIT->APPLY_CONV_INPUT
                    EXPORTING
                      INPUT  = <TD_FIELD>
                    IMPORTING
                      OUTPUT = <TD_FIELD>.
                ELSEIF SY-SUBRC = 0 AND WA_FIELDCATALOG-INTTYPE = 'D'.
    * APPLY DATE CONVERSION AS THERE IS NO COVERSION EXIT FOR DATES DUE TO
    * SAPGUI DISPLAY FORMATS BASED ON USER PROFILES
                  TRY.
                      DATE_CONV = ETK_ROW_WA-CHAVLEXT.
                      CALL METHOD CL_ABAP_CONV_DATE=>CONVERT_DATE_EXT2INT
                        EXPORTING
                          EXTERNAL_DATE = DATE_CONV
                        RECEIVING
                          INTERNAL_DATE = <TD_FIELD>.
                    CATCH CX_DATE_CONVERSION .
    * THERE SHOULD BE NO DATE CONVERSION ERROR.
                  ENDTRY.
                ELSE.
                  <TD_FIELD> = ETK_ROW_WA-CHAVLEXT.
                ENDIF.
              ENDIF.
            ELSE.
    * FAILURE TO FIND THE FIELD IN THE POINTER WILL RESULT IN
    * TRANSACTION DATA INTEGRITY ISSUES, WE SHOULD ERROR OUT
              CONCATENATE FIND_FIELD_ERR ETK_ROW_WA-CHANM
                INTO MESSAGE.
              CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>FORCE_ERROR_MESSAGE
                EXPORTING
                  MESSAGE = MESSAGE.
            ENDIF.
          ENDIF.
        ENDLOOP.
    * APPEND THE LAST ROW
        IF HAS_DATA IS NOT INITIAL.
          APPEND <TD_WA> TO <TD_TAB>.
        ENDIF.
    * INSERT ALL KEY FIGURES
        LOOP AT KEYFIG_DATA INTO KEYFIG_DATA_WA.
          READ TABLE <TD_TAB> INTO <TD_WA> INDEX KEYFIG_DATA_WA-ROW.
          IF SY-SUBRC <> 0.
    * SUMMARY LINE WHICH INDICATES COMPLETION
            EXIT.
          ENDIF.
    * AVAILABLE KEY FIGURES
          READ TABLE ETK_COL INTO ETK_COL_WA
            INDEX KEYFIG_DATA_WA-COL.
          ASSIGN COMPONENT ETK_COL_WA-CHAVLEXT OF STRUCTURE
            <TD_WA> TO <TD_FIELD>.
          IF SY-SUBRC = 0.
            READ TABLE ME->IT_FIELDCATALOG INTO WA_FIELDCATALOG
              WITH TABLE KEY FIELDNAME = ETK_COL_WA-CHAVLEXT.
            IF WA_FIELDCATALOG-INTTYPE = 'P'.
              DECIMAL_CONV = KEYFIG_DATA_WA-VALUE.
              CALL METHOD CL_ABAP_CONV_DECIMAL=>CONVERT_DECIMAL_EXT2INT
                EXPORTING
                  EXTERNAL_VALUE = DECIMAL_CONV
                CHANGING
                  INTERNAL_VALUE = <TD_FIELD>.
            ELSEIF WA_FIELDCATALOG-INTTYPE = 'F' OR
              WA_FIELDCATALOG-INTTYPE = 'I'.
              <TD_FIELD> = KEYFIG_DATA_WA-VALUE.
            ENDIF.
            MODIFY <TD_TAB> INDEX KEYFIG_DATA_WA-ROW FROM <TD_WA>
              TRANSPORTING (ETK_COL_WA-CHAVLEXT) .
          ELSE.
    * FAILURE TO FIND THE FIELD IN THE POINTER WILL RESULT IN
    * TRANSACTION DATA INTEGRITY ISSUES, WE SHOULD ERROR OUT
            CONCATENATE FIND_FIELD_ERR ETK_ROW_WA-CHANM
              INTO MESSAGE.
            CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>FORCE_ERROR_MESSAGE
              EXPORTING
                MESSAGE = MESSAGE.
          ENDIF.
        ENDLOOP.
      ENDMETHOD.                   "READ_DATA
      METHOD SET_CHARACTERISTIC_SELECTION.
        DATA: CHARACTERISTIC_SELECTION_WA TYPE UPC_YS_API_CHASEL.
        DATA: WA_FIELDCATALOG TYPE LVC_S_FCAT.
        DATA: CONV_EXIT TYPE STRING.
        DATA: DATE_CONV TYPE STRING.
        DATA: TEMP_DATE TYPE D.
    * basically convert the selection criteria to external values and hold
    * copy of that
        REFRESH ME->CHARACTERISTIC_SELECTION.
        LOOP AT CHARACTERISTIC_SELECTION INTO CHARACTERISTIC_SELECTION_WA.
          READ TABLE ME->IT_FIELDCATALOG INTO WA_FIELDCATALOG
            WITH TABLE KEY FIELDNAME = CHARACTERISTIC_SELECTION_WA-CHANM.
          IF SY-SUBRC = 0.
            IF NOT WA_FIELDCATALOG-CONVEXIT IS INITIAL.
              DATA: CONVEXIT_WA TYPE CONVEXIT_LOOKUP_S.
              READ TABLE ME->CONVEXIT_LOOKUP INTO CONVEXIT_WA
                WITH TABLE KEY CONVEXIT = WA_FIELDCATALOG-CONVEXIT.
              CALL METHOD CONVEXIT_WA-O_CONVEXIT->APPLY_CONV_OUTPUT
                EXPORTING
                  INPUT  = CHARACTERISTIC_SELECTION_WA-LOW
                IMPORTING
                  OUTPUT = CHARACTERISTIC_SELECTION_WA-LOW.
              CALL METHOD CONVEXIT_WA-O_CONVEXIT->APPLY_CONV_OUTPUT
                EXPORTING
                  INPUT  = CHARACTERISTIC_SELECTION_WA-HIGH
                IMPORTING
                  OUTPUT = CHARACTERISTIC_SELECTION_WA-HIGH.
            ELSEIF WA_FIELDCATALOG-INTTYPE = 'D'.
    * DATE TYPE CONVERSION BASED ON SAP GUI
              IF NOT CHARACTERISTIC_SELECTION_WA-LOW IS INITIAL.
                TEMP_DATE = CHARACTERISTIC_SELECTION_WA-LOW.
                CALL METHOD CL_ABAP_CONV_DATE=>CONVERT_DATE_INT2EXT
                  EXPORTING
                    INTERNAL_DATE = TEMP_DATE
                  RECEIVING
                    EXTERNAL_DATE = DATE_CONV.
                CHARACTERISTIC_SELECTION_WA-LOW = DATE_CONV.
              ENDIF.
              IF NOT CHARACTERISTIC_SELECTION_WA-HIGH IS INITIAL.
                TEMP_DATE = CHARACTERISTIC_SELECTION_WA-HIGH.
                CALL METHOD CL_ABAP_CONV_DATE=>CONVERT_DATE_INT2EXT
                  EXPORTING
                    INTERNAL_DATE = TEMP_DATE
                  RECEIVING
                    EXTERNAL_DATE = DATE_CONV.
                CHARACTERISTIC_SELECTION_WA-HIGH = DATE_CONV.
              ENDIF.
            ENDIF.
            APPEND CHARACTERISTIC_SELECTION_WA TO
    ME->CHARACTERISTIC_SELECTION.
          ENDIF.
        ENDLOOP.
      ENDMETHOD.                   "SET_CHARACTERISTIC_SELECTION
      METHOD SET_PLANNING_AREA.
        DATA: ES_RETURN TYPE BAPIRET2.
        DATA: E_SUBRC TYPE SY-SUBRC.
    * CHECK TO SEE OF PLANNING AREA IS A MULTI-PLANNING AREA
        CALL FUNCTION 'API_SEMBPS_AREA_GETDETAIL'
          EXPORTING
            I_AREA     = PLANNING_AREA
          IMPORTING
            E_SUBRC    = E_SUBRC
            ES_RETURN  = ES_RETURN
          TABLES
            ETK_CHAPRO = ME->CHARACTERISTICS
            ETK_KYFPRO = ME->KEYFIGURES.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
          EXPORTING
            E_SUBRC       = E_SUBRC
            RETURN_STRUCT = ES_RETURN.
        ME->PLANNING_AREA = PLANNING_AREA.
    * FIND THE INFOCUBE RELATED TO THE PLANNING AREA
        SELECT SINGLE INFOCUBE FROM UPC_BW_AREA INTO ME->INFOCUBE
          WHERE AREA = PLANNING_AREA.
        CALL METHOD ME->VALIDATE_PLANNING_OBJECTS.
      ENDMETHOD.                   "SET_PLANNING_AREA
      METHOD VALIDATE_PLANNING_OBJECTS.
        DATA: E_SUBRC TYPE SY-SUBRC.
        DATA: ES_RETURN TYPE BAPIRET2.
        DATA: ES_RETURN_T TYPE TABLE OF BAPIRET2.
        DATA: ETK_CHA TYPE TABLE OF UPC_YS_API_PLEVEL_CHA.
        DATA: ETK_CHA_WA TYPE UPC_YS_API_PLEVEL_CHA.
        DATA: CHARACTERISTIC_WA TYPE UPC_YS_API_CHAPRO.
        DATA: KEYFIGURES_WA TYPE UPC_YS_API_KYFPRO.
        DATA: ETK_CHASEL TYPE TABLE OF UPC_YS_API_CHASEL.
        DATA: ETK_KYF TYPE TABLE OF UPC_YS_KYF.
        DATA: ETK_RETURN TYPE TABLE OF BAPIRET2.
        DATA: LINES1 TYPE I.
        DATA: LINES2 TYPE I.
        DATA: E_LEADCOL_COMPL TYPE UPC_YS_API_INFO-LEADCOL_COMPL.
        DATA: ETK_HEAD_INFO TYPE TABLE OF UPC_YS_API_HEAD_INFO.
        DATA: ETK_ROW_INFO TYPE TABLE OF UPC_YS_API_ROW_INFO.
        DATA: ETK_COL_INFO TYPE TABLE OF UPC_YS_API_COL_INFO.
    * CHECK TO SEE IF ITS A MULTI-PLANNING AREA
        READ TABLE ME->CHARACTERISTICS TRANSPORTING NO FIELDS
          WITH KEY CHANM = CL_SEMBPS_DATA_ACCESSOR=>C_MULTIPLAN_AREA.
    * MULTI-PLANNING AREAS SHOULD NOT BE ACCEPTABLE TO THIS AS IT LEADS
    * TO REFERENCING OF PLANNING AREAS IN ITS LEVEL/PACKAGES/LAYOUTS WHICH
    * IS HARDER TO MAINTAIN
        IF SY-SUBRC = 0.
          REFRESH ME->CHARACTERISTICS.
          REFRESH ME->KEYFIGURES.
          CLEAR ES_RETURN.
          ES_RETURN-TYPE = 'E'.
          ES_RETURN-MESSAGE = 'DO NOT USE MULTI-PLANNING AREAS'.
          APPEND ES_RETURN TO ES_RETURN_T.
          CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>FORCE_ERROR_MESSAGE
            EXPORTING
              RETURN_STRUCTS = ES_RETURN_T.
        ENDIF.
    * CHECK THE PLANNING LEVEL
        CALL FUNCTION 'API_SEMBPS_PLEVEL_GETDETAIL'
          EXPORTING
            I_AREA     = ME->PLANNING_AREA
            I_PLEVEL   = CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
          IMPORTING
            E_SUBRC    = E_SUBRC
            ES_RETURN  = ES_RETURN
          TABLES
            ETK_CHA    = ETK_CHA
            ETK_CHASEL = ETK_CHASEL
            ETK_KYF    = ETK_KYF.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGE
          EXPORTING
            E_SUBRC       = E_SUBRC
            RETURN_STRUCT = ES_RETURN.
    * CHECK TO SEE IF THE SAME NUMBER OF CHARACTERISTICS EXISTS IN LEVEL
        DESCRIBE TABLE ME->CHARACTERISTICS LINES LINES1.
        DESCRIBE TABLE ETK_CHA LINES LINES2.
        IF LINES1 <> LINES2.
    * ERROR OUT THE MISSING CHARACTERISTICS FROM THE PLANNING LEVEL
          LOOP AT ME->CHARACTERISTICS INTO CHARACTERISTIC_WA.
            READ TABLE ETK_CHA WITH KEY CHANM = CHARACTERISTIC_WA-CHANM
              TRANSPORTING NO FIELDS.
            IF SY-SUBRC <> 0.
              CLEAR ES_RETURN.
              ES_RETURN-TYPE = 'E'.
              CONCATENATE 'Missing characteristic ' CHARACTERISTIC_WA-CHANM
                ' from planning level ' CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
                INTO ES_RETURN-MESSAGE.
              APPEND ES_RETURN TO ES_RETURN_T.
            ENDIF.
          ENDLOOP.
        ENDIF.
    * CHECK TO SEE IF EVERY CHARACTERISTIC IS AVAIABLE FOR SELECTION IN
    * PACKAGE
        READ TABLE ETK_CHA WITH KEY PACKSEL = SPACE TRANSPORTING NO FIELDS.
        IF SY-SUBRC = 0.
    * ERROR OUT THE CHARACTERISTICS THAT ARE NOT AVAILABLE FOR PACKAGE
    * SELECTIONS
          LOOP AT ETK_CHA INTO ETK_CHA_WA WHERE PACKSEL = SPACE.
            CLEAR ES_RETURN.
            ES_RETURN-TYPE = 'E'.
            CONCATENATE 'Characteristic ' ETK_CHA_WA-CHANM
              ' needs to be available for selection in planning level '
              CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL INTO ES_RETURN-MESSAGE.
            APPEND ES_RETURN TO ES_RETURN_T.
          ENDLOOP.
        ENDIF.
    * CHECK TO SEE IF THE SAME NUMBER OF KEYFIGURES EXISTS IN LEVEL
        DESCRIBE TABLE ME->KEYFIGURES LINES LINES1.
        DESCRIBE TABLE ETK_KYF LINES LINES2.
        IF LINES1 <> LINES2.
    * ERROR OUT THE MISSING KEYFIGURES FROM THE PLANNING LEVEL
          LOOP AT ME->KEYFIGURES INTO KEYFIGURES_WA.
            READ TABLE ETK_KYF WITH KEY KYFNM = KEYFIGURES_WA-KYFNM
              TRANSPORTING NO FIELDS.
            IF SY-SUBRC <> 0.
              CLEAR ES_RETURN.
              ES_RETURN-TYPE = 'E'.
              CONCATENATE 'Missing keyfigure ' KEYFIGURES_WA-KYFNM
                ' from planning level ' CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
                INTO ES_RETURN-MESSAGE.
              APPEND ES_RETURN TO ES_RETURN_T.
            ENDIF.
          ENDLOOP.
        ENDIF.
    * CHECK THE PLANNING LAYOUT
        CALL FUNCTION 'API_SEMBPS_LAYOUT_GETDETAIL'
          EXPORTING
            I_AREA          = ME->PLANNING_AREA
            I_PLEVEL        = CL_SEMBPS_DATA_ACCESSOR=>C_LEVEL
            I_LAYOUT        = CL_SEMBPS_DATA_ACCESSOR=>C_LAYOUT
          IMPORTING
            E_SUBRC         = E_SUBRC
            E_LEADCOL_COMPL = E_LEADCOL_COMPL
          TABLES
            ETK_HEAD_INFO   = ETK_HEAD_INFO
            ETK_ROW_INFO    = ETK_ROW_INFO
            ETK_COL_INFO    = ETK_COL_INFO
            ETK_RETURN      = ETK_RETURN.
        CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>CHECK_MESSAGES
          EXPORTING
            E_SUBRC        = E_SUBRC
            RETURN_STRUCTS = ETK_RETURN.
    * MAKE SURE THAT HEADER AREA IS EMPTY AS ALL THE DATA READ IS IN LEAD
    * COLUMNS ONLY
        IF NOT ETK_HEAD_INFO[] IS INITIAL.
          CLEAR ES_RETURN.
          ES_RETURN-TYPE = 'E'.
          CONCATENATE 'Header area must be empty in layout '
            CL_SEMBPS_DATA_ACCESSOR=>C_LAYOUT
            INTO ES_RETURN-MESSAGE.
          APPEND ES_RETURN TO ES_RETURN_T.
        ENDIF.
    * MAKE SURE THAT LAYOUT TYPE IS KEY FIGURES IN DATA COLUMNS
        IF NOT E_LEADCOL_COMPL IS INITIAL.
          CLEAR ES_RETURN.
          ES_RETURN-TYPE = 'E'.
          CONCATENATE 'Layout ' CL_SEMBPS_DATA_ACCESSOR=>C_LAYOUT
            ' must be of type "Key Figs in data columns"'
            INTO ES_RETURN-MESSAGE.
          APPEND ES_RETURN TO ES_RETURN_T.
        ENDIF.
    * CHECK FOR THE SAME NUMBER OF CHARACTERISTICS IN LEAD COLUMNS OF LAYOUT
    * AND IN PLANNING AREA
        DESCRIBE TABLE ME->CHARACTERISTICS LINES LINES1.
        DESCRIBE TABLE ETK_ROW_INFO LINES LINES2.
        IF LINES1 <> LINES2.
    * ERROR OUT THE MISSING CHARACTERISTICS FROM THE PLANNING LEVEL
          LOOP AT ME->CHARACTERISTICS INTO CHARACTERISTIC_WA.
            READ TABLE ETK_ROW_INFO WITH KEY CHANM = CHARACTERISTIC_WA-CHANM
              TRANSPORTING NO FIELDS.
            IF SY-SUBRC <> 0.
              CLEAR ES_RETURN.
              ES_RETURN-TYPE = 'E'.
              CONCATENATE 'Missing characteristic ' CHARACTERISTIC_WA-CHANM
                ' from planning layout ' CL_SEMBPS_DATA_ACCESSOR=>C_LAYOUT
                INTO ES_RETURN-MESSAGE.
              APPEND ES_RETURN TO ES_RETURN_T.
            ENDIF.
          ENDLOOP.
        ENDIF.
    * IF MESSAGES ARE AVAILBLE FROM CUSTOM CHECKS THROW EXCEPTION
        IF NOT ES_RETURN_T[] IS INITIAL.
          CALL METHOD CL_SEMBPS_DATA_ACCESSOR=>FORCE_ERROR_MESSAGE
            EXPORTING
              RETURN_STRUCTS = ES_RETURN_T.
        ENDIF.
      ENDMETHOD.                   "VALIDATE_PLANNING_OBJECTS
    ENDCLASS.                   "CL_SEMBPS_DATA_ACCESSOR IMPLEMENTATION
    *       CLASS CL_SEMBPS_DATA_ACCESS_FACTORY DEFINITION
    CLASS CL_SEMBPS_DATA_ACCESS_FACTORY DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS CREATE_DATA_ACCESSOR
          IMPORTING
            PLAN_AREA TYPE UPC_AREA-AREA
            CHARACTERISTIC_SELECTION TYPE UPC_YS_API_CHASEL_T
            DDIC_STRUCTURE_NAME TYPE DD02L-TABNAME OPTIONAL
          EXPORTING
            O_DATA_ACCESSOR TYPE REF TO CL_SEMBPS_DATA_ACCESSOR
          CHANGING
            TRANSACTION_DATA_TABLE TYPE STANDARD TABLE OPTIONAL
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
        CLASS-METHODS GET_PLANNING_AREA_SPECS
          IMPORTING
            PLANNING_AREA TYPE UPC_AREA-AREA
          EXPORTING
            TRANSACTION_DATA_STRUCT TYPE REF TO DATA
            KEYFIGURES TYPE UPC_YS_API_KYFPRO_T
            FIELDCATALOG TYPE LVC_T_FCAT
            CHARACTERISTICS TYPE UPC_YS_API_CHAPRO_T
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
      PRIVATE SECTION.
        CLASS-DATA PLAN_AREA_CACHE TYPE PLAN_AREA_STRUCT_CACHE_T .
        CLASS-METHODS CREATE_DYNAMIC_STRUCTURE
          IMPORTING
            PLANNING_AREA TYPE UPC_AREA-AREA
          EXPORTING
            TRANSACTION_DATA_STRUCT TYPE REF TO DATA
            KEYFIGURES TYPE UPC_YS_API_KYFPRO_T
            FIELDCATALOG TYPE LVC_T_FCAT
            CHARACTERISTICS TYPE UPC_YS_API_CHAPRO_T
          RAISING
            CX_SEM_BPS_DATA_ACCESS .
    ENDCLASS.                   "CL_SEMBPS_DATA_ACCESS_FACTORY DEFINITION
    *       CLASS CL_SEMBPS_DATA_ACCESS_FACTORY IMPLEMENTATION
    CLASS CL_SEMBPS_DATA_ACCESS_FACTORY IMPLEMENTATION.
      METHOD CREATE_DATA_ACCESSOR.
        DATA: TRANSACTION_DATA_STRUCT TYPE REF TO DATA.
        DATA: FIELDCATALOG TYPE LVC_T_FCAT.
        IF TRANSACTION_DATA_TABLE IS SUPPLIED
          AND DDIC_STRUCTURE_NAME IS SUPPLIED AND
          NOT DDIC_STRUCTURE_NAME IS INITIAL.
    * RETRIEVE FIELD CATALOG OF THE DDIC STRUCTURE TO PROVIDE
          CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
            EXPORTING
              I_STRUCTURE_NAME       = DDIC_STRUCTURE_NAME
            CHANGING
              CT_FIELDCAT            = FIELDCATALOG
            EXCEPTIONS
              INCONSISTENT_INTERFACE = 1
              PROGRAM_ERROR          = 2
              OTHERS                 = 3.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          GET REFERENCE OF TRANSACTION_DATA_TABLE INTO
    TRANSACTION_DATA_STRUCT.
        ELSE.
    * GENERATE INTERNAL TABLE AND ITS FIELD CATALOG DYNAMICALLY
          CALL METHOD CL_SEMBPS_DATA_ACCESS_FACTORY=>GET_PLANNING_AREA_SPECS
            EXPORTING
              PLANNING_AREA           = PLAN_AREA
            IMPORTING
              TRANSACTION_DATA_STRUCT = TRANSACTION_DATA_STRUCT
              FIELDCATALOG            = FIELDCATALOG.
        ENDIF.
    * CREATE DATA ACCESSOR
        CREATE OBJECT O_DATA_ACCESSOR
          EXPORTING
            PLANNING_AREA = PLAN_AREA
            IT_FIELDCATALOG = FIELDCATALOG
            TRANSACTION_DATA_TABLE = TRANSACTION_DATA_STRUCT
            CHARACTERISTIC_SELECTION = CHARACTERISTIC_SELECTION.
      ENDMETHOD.                   "CREATE_DATA_ACCESSOR
      METHOD GET_PLANNING_AREA_SPECS.
        DATA: PLAN_AREA_CACHE_WA TYPE PLAN_AREA_STRUCT_CACHE.
        FIELD-SYMBOLS: <TD_TAB_DEFINITION> TYPE STANDARD TABLE.
        READ TABLE PLAN_AREA_CACHE
          WITH TABLE KEY PLANNING_AREA = PLANNING_AREA
          INTO PLAN_AREA_CACHE_WA.
    * CREATE INTERNAL TABLE REFLECTING THE PLANNING AREA AND CACHE IT
    * TO AVOID TOO MANY CALLS TO CREATION OF DYNAMIC INTERNAL TABLES
    * SAP HAS RESTRICTED DEVELOPERS FROM CREATING
        IF SY-SUBRC <> 0.
          CLEAR PLAN_AREA_CACHE_WA.
          CALL METHOD
    CL_SEMBPS_DATA_ACCESS_FACTORY=>CREATE_DYNAMIC_STRUCTURE
            EXPORTING
              PLANNING_AREA           = PLANNING_AREA
            IMPORTING
              TRANSACTION_DATA_STRUCT =
    PLAN_AREA_CACHE_WA-TRANSACTION_DATA_TABLE
              KEYFIGURES              = PLAN_AREA_CACHE_WA-KEYFIGURES
              FIELDCATALOG            = PLAN_AREA_CACHE_WA-FIELDCATALOG
              CHARACTERISTICS         = PLAN_AREA_CACHE_WA-CHARACTERISTICS.
          PLAN_AREA_CACHE_WA-PLANNING_AREA = PLANNING_AREA.
          INSERT PLAN_AREA_CACHE_WA INTO TABLE PLAN_AREA_CACHE.
        ENDIF.
        FIELDCATALOG[] = PLAN_AREA_CACHE_WA-FIELDCATALOG.
        CHARACTERISTICS[] = PLAN_AREA_CACHE_WA-CHARACTERISTICS[].
        KEYFIGURES[] = PLAN_AREA_CACHE_WA-KEYFIGURES[].
        ASSIGN PLAN_AREA_CACHE_WA-TRANSACTION_DATA_TABLE->*
          TO <TD_TAB_DEFINITION>.
    * CREATE A NEW REFERENCE
        CREATE DATA TRANSACTION_DATA_STRUCT LIKE
          <TD_TAB_DEFINITION>.
      ENDMETHOD.                   "GET_PLANNING_AREA_SPECS
      METHOD CREATE_DYNAMIC_STRUCTURE.
        DATA: ES_RETURN TYPE BAPIRET2.
        DATA: E_SUBRC TYPE SY-SUBRC.
        DATA: MESSAGE TYPE STRING.
        CALL FUNCTION 'API_SEMBPS_AREA_GETDETAIL'
          EXPORTING
            I_AREA     = PLANNING_AREA
          IMPORTING
            E_SUBRC    = E_SUBRC
            ES_RETURN  = ES_RETURN
          TABLES
            ETK_CHAPRO = CHARACTERISTICS
            ETK_KYFPRO = KEYFIGURES.
        IF E_SUBRC <> 0.
          MESSAGE = ES_RETURN-MESSAGE.
          RAISE EXCEPTION TYPE CX_SEM_BPS_DATA_ACCESS
            EXPORTING MESSAGE = MESSAGE.
        ENDIF.
        READ TABLE CHARACTERISTICS TRANSPORTING NO FIELDS
          WITH KEY CHANM = CL_SEMBPS_DATA_ACCESSOR=>C_MULTIPLAN_AREA.
        IF SY-SUBRC = 0.
          MESSAGE = 'DO NOT USE MULTI-PLANNING AREAS'.
          RAISE EXCEPTION TYPE CX_SEM_BPS_DATA_ACCESS
            EXPORTING MESSAGE = MESSAGE.
        ENDIF.
        DATA: CHAR_WA TYPE UPC_YS_API_CHAPRO.
        DATA: KEYFIG_WA TYPE UPC_YS_API_KYFPRO.
        DATA: WA_FIELDCATALOG TYPE LVC_S_FCAT.
        DATA: RETURN TYPE BAPIRET2.
        DATA: DETAILS TYPE BAPI6108.
    * CHARACTERISTIC FIELDCATALOG
        LOOP AT CHARACTERISTICS INTO CHAR_WA.
          WA_FIELDCATALOG-INTTYPE = CHAR_WA-INTTP.
          WA_FIELDCATALOG-FIELDNAME = CHAR_WA-CHANM.
          WA_FIELDCATALOG-DATATYPE = CHAR_WA-DATATP.
          WA_FIELDCATALOG-INTLEN = CHAR_WA-INTLEN.
          WA_FIELDCATALOG-DECIMALS = CHAR_WA-DECIMALS.
          WA_FIELDCATALOG-OUTPUTLEN = CHAR_WA-OUTPUTLEN.
          CALL FUNCTION 'BAPI_IOBJ_GETDETAIL'
            EXPORTING
              INFOOBJECT = CHAR_WA-CHANM
            IMPORTING
              DETAILS    = DETAILS
              RETURN     = RETURN.
          IF RETURN-TYPE = 'E'.
            MESSAGE = RETURN-MESSAGE.
            RAISE EXCEPTION TYPE CX_SEM_BPS_DATA_ACCESS
              EXPORTING MESSAGE = MESSAGE.
          ENDIF.
          WA_FIELDCATALOG-CONVEXIT = DETAILS-CONVEXIT.
          APPEND WA_FIELDCATALOG TO FIELDCATALOG.
        ENDLOOP.
    * KEYFIGURE FIELDCATALOG
        LOOP AT KEYFIGURES INTO KEYFIG_WA.
          WA_FIELDCATALOG-INTTYPE = KEYFIG_WA-INTTP.
          WA_FIELDCATALOG-FIELDNAME = KEYFIG_WA-KYFNM.
          WA_FIELDCATALOG-DATATYPE = KEYFIG_WA-DATATP.
          WA_FIELDCATALOG-INTLEN = KEYFIG_WA-DIGITS.
          WA_FIELDCATALOG-DECIMALS = KEYFIG_WA-DECIMALS.
          WA_FIELDCATALOG-DD_OUTLEN = KEYFIG_WA-OUTPUTLEN.
          CALL FUNCTION 'BAPI_IOBJ_GETDETAIL'
            EXPORTING
              INFOOBJECT = KEYFIG_WA-KYFNM
            IMPORTING
              DETAILS    = DETAILS
              RETURN     = RETURN.
          IF RETURN-TYPE = 'E'.
            MESSAGE = RETURN-MESSAGE.
            RAISE EXCEPTION TYPE CX_SEM_BPS_DATA_ACCESS
              EXPORTING MESSAGE = MESSAGE.
          ENDIF.
          WA_FIELDCATALOG-CONVEXIT = DETAILS-CONVEXIT.
          APPEND WA_FIELDCATALOG TO FIELDCATALOG.
        ENDLOOP.
    * AVOID TOO MANY CALLS TO THIS FUNCTION MODULE
        IF NOT FIELDCATALOG[] IS INITIAL.
          CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
            EXPORTING
              IT_FIELDCATALOG           = FIELDCATALOG
            IMPORTING
              EP_TABLE                  = TRANSACTION_DATA_STRUCT
            EXCEPTIONS
              GENERATE_SUBPOOL_DIR_FULL = 1
              OTHERS                    = 2.
          CASE SY-SUBRC.
            WHEN 1.
              RAISE EXCEPTION TYPE CX_SEM_BPS_DATA_ACCESS EXPORTING
                  MESSAGE = 'Dynamic table creation failure on subpool'.
            WHEN 2.
              RAISE EXCEPTION TYPE CX_SEM_BPS_DATA_ACCESS EXPORTING
                  MESSAGE = 'Dynamic table creation failure'.
          ENDCASE.
        ENDIF.
      ENDMETHOD.                   "CREATE_DYNAMIC_STRUCTURE
    ENDCLASS.           "CL_SEMBPS_DATA_ACCESS_FACTORY IMPLEMENTATION
    Look at this link:
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee19446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee19446011d189700000e8322d00/frameset.htm</a>
    Pls reward points.
    Regards,
    Ameet

  • Stock analysis based on vendor material number

    Hi
    Is there any report which can show the total stock of a material with split on vendor material number (I am entering different vendor material numbers upon goods receipt) or any query I can write to get the above result?
    The requirement is as follows: I will order an item with name say X and vendor supplies the item with different name say Y. So I am maintaining vendor specific name in vendor material number. Now I want to see the stock X with what quantity of it is Y.
    Thanks

    Dear Praveen
    You could use the following;
    Input and Output Conversion of Material Numbers  
    Use
    Like every other part in the SAP system, an inventory-managed manufacturer part has an SAP-specific material number that uniquely identifies it. If this material number is uncommon or unknown to the vendor, you should consider the following (especially in the purchasing process):
    ·        You can enter a part with its Manufacturer Part Number (MPN) and its External Manufacturer, and not just with its material number. This is possible because of the input conversion of material numbers.
    ·        The system displays this part with its Manufacturer Part Number and the External Manufacturer in lists and screens. This is possible because of the output conversion of material numbers.
    You have to increase the maximum field length for input and output values in the Output Length for Material Numbers field to enter and display the MPN and the manufacturer code in one field
    Prerequisites
    You have made the following settings in Customizing:
    ·        You have activated the conversion exit for material numbers.
    ·        You have maintained a delimiter. The delimiter separates the MPN and the external manufacturer when they are entered or displayed in one field.
    ·        You have specified a maximum output length for material numbers. This means that the fields for the long material number are scrollable, and the output columns for lists are wider.
    You configure and activate the conversion exit for material numbers in Customizing by choosing Logistics - General ® Interchangeability of Parts ® Set Up Conversion Exit for Material Numbers.
    Features
    Input Conversion
    If you have activated the conversion exit, you can enter the relevant MPN instead of the material number in the relevant input fields.
    If the MPN is not unique, you enter the external manufacturer in the same field, separating the MPN and the external manufacturer by the delimiter defined in Customizing.
    You have defined: as the delimiter.
    Enter 45L700W:36121 (Manufacturer Part Number, Delimiter,and External Manufacturer) for the part, instead of material number 1011. If the MPN is unique, you only have to enter 45L700W (the Manufacturer Part Number).
    You can now scroll the input field for the material number. This allows you to enter the maximum output length for material numbers, which has also been defined in Customizing.
    Input conversion gives you an alternate and additional input option. You can still enter the ERP material number to identify a part.
    The system determines the correct material number from your input, and passes it to the program logic. The system handles your input as follows:
    ·        If your entry contains the delimiter, the system splits the entry at the delimiter, interprets both parts of the entry as the Manufacturer Part Number and the External Manufacturer respectively, and searches for a part corresponding to these entries
    ·        If your entry does not contain a delimiter, the system interprets your entry as an (ERP) material number, and searches for the corresponding part in the material master. If this is unsuccessful, the system interprets your entry as an MPN, and searches for the corresponding part.
    If the system cannot determine a part clearly, or the search is unsuccessful, it issues an error message.
    Value Range for MPN on the Selection Screen
    The system converts the MPN into a material number internally.
    To ensure that the system correctly interprets the value range for an MPN that is entered as selection criteria, when the conversion exit is activated, the system provides both the material number and the MPN as selection criteria in the selection screen.
    Output Conversion
    If the conversion exit is activated, the output conversion ensures that the system displays the MPN and the external manufacturer on screens and in lists, separated by the delimiter in the field or column that usually displays the ERP material number.
    If the Output Length for Material Numbers field in Customizing is not long enough to display both the MPN and the external manufacturer, the system displays the MPN, if it is unique.
    If the MPN is not unique or the output length too short, the system displays the ERP material number.
    The system displays parts with the output length defined in Customizing. In addition:
    ·        You can scroll the output field for the material number on screens.
    ·        The system adjusts the layout of lists to the output length.
    List Formatting
    If you use the inventory-managed MPN, you have to change the list formatting as follows:
    ·        Variable length of the material number in reports
    In cases of the automatic conversion of the material number into an MPN and external manufacturer, the system takes account of the Output Length for Material Numbers field (defined in Customizing) when it structures the lists for selected reports. This ensures that columns are aligned, line breaks are correct, and the lists can be read.
    ·        Adding a field for the external manufacturer
    The external manufacturer should also be displayed in lists because the MPN, into which the material number is automatically converted, is not always unique.
    In Customizing, you have defined whether the external manufacturer should be displayed with the MPN. The system adds the field for the external manufacturer immediately after the field for the MPN in lists and on the screen.
    You can display the external manufacturer with or without an active conversion exit.
    ·        Sorting by MPN, not by material number
    You can sort some lists by material number.
    You can sort by MPN in cases where the MPN is displayed instead of the material number.
    with kind regards
    Sundar

  • Strange Data Mapping Errors after SEM 6 Upgrade. Please assist.

    Hi All, I encountered these sudden Mapping errors after I tried to do Testing in Post Upgrade Sand Box. Here I am trying to to perform Collected Reported Financial Data under Data Collection Method for a particular Company Code 3040. Kindly help me with some quick responses as this is kind of high priority. The errors and the Diagnosis Notes I am unable to follow as I do not where I shall write those Mapping Rules they are referring to. I do not even know if that need to apply any SAP Notes as such. Once again Highly appreciate your quick response and Many Thanks in Advance.
    Regards, BIP
    Input conversion for field Period Value LC has invalid format Message no. UCT8210 Diagnosis The mapping rule for target field Period Value LC contains a move with a selected Input Conversion indicator. Therefore, the system performs an input conversion prior to creating the target data. However, an error in the input conversion occurred while moving the source key figure to the target key figure Period Value LC. This means that the format used for the input conversion is incompatible with the target data. System Response The system will not perform the move. Procedure Examine the mapping rule for field Period Value LC. Either select the Conversion Exit indicator or deselect the Input Conversion indicator. Execute the method again. -
    3040 is incompatible with input format for field /1FB/COMPANY Message no. UCT8258 Diagnosis During execution, the method derives the source selection for source field /1FB/COMPANY from the mapping rule for the target field. 3040 is one of the values that were derived for the source selection. The system requires that this value is in the correct SAP-internal format because the Conversion Exit indicator has been selected in the move operator for field /1FB/COMPANY. However, the value 3040 is incompatible with the SAP-internal format. System Response The system attempts to interpret value 3040 as an external format and convert it to the internal format. If this fails, the system is unable to restrict the source selection using source field /1FB/COMPANY. In this case, the system may read more source data than was originally intended, which can affect performance. Procedure In the log, choose the Source button to display the source selections that are used to read the source data. When this appears, examine values selected for field /1FB/COMPANY. If the correct values were selected, you can ignore this message. To prevent this message from being issued, you can select the indicator in the mapping rule used by source field /1FB/COMPANY. If incorrect values were selected, make sure that the mapping rule used by source field /1FB/COMPANY has been defined correctly. If the mapping rule is correct and value (3040) derived for the source selection does not affect the overall result, you can ignore this message. If the source selection does not contain the value 3040 for field /1FB/COMPANY and, because of this, source data that is supposed to be read is not being read, make sure that the mapping rule has been defined correctly. If the source selection does not contain any value for field /1FB/COMPANY, make an estimation as to how much excess source data is being read and whether this might affect system performance. If you do not expect any performance problems, you can ignore this message. In any event, you have the following alternatives if the mapping rule is defined correctly, but the source selection on field /1FB/COMPANY is unsatisfactory: You can define a source selection for field /1FB/COMPANY in the Customizing settings for the method on the Selection tab page. Then the method uses this source selection instead of the source selection derived from inverse interpretation of the mapping rule. You can implement the Business Add-In (BAdI) UC_DATATRANSFER and use the method INVERT to determine the source selection on field /1FB/COMPANY. Then the method uses the result of the INVERT method for the source selection instead of the source selection derived from inverse interpretation of the mapping rule. -
    Cannot derive the source selection from target field Version Message no. UCT8252 Diagnosis Field Version has one of the following roles: Consolidation unit Group currency key Fiscal year Posting period Version To delimit the volume of the source data to be read, the system usually derives the source selection from the target selection of such a field. However, the system cannot derive a source selection from field Version. System Response It is possible that a greater volume of source data is being read than is necessary. This can lead to performance issues. Procedure Check whether a mapping rule is defined for field Version. If a mapping rule is defined, you can disregard this warning message. However, if you discover after method execution that the system did not process a large amount of data, and that system performance was not satisfactory, you may want to examine the source selection by choosing the Source button in the log. If the reason for the disregarded data is that too much source data was read because of the unrestricted selection on the source field (which is linked with target field Versionthrough mapping), choose one of the alternatives below: Change the mapping rule for field Version so that the system can derive a delimiting source selection. Implement the Business Add-In (BAdI) UC_DATATRANSFER with the method INVERT to delimit the selection for the source field that is linked via mapping to the target field Version. -
    Cannot derive the source selection from target field Group Currency Message no. UCT8252 Diagnosis Field Group Currency has one of the following roles: Consolidation unit Group currency key Fiscal year Posting period Version To delimit the volume of the source data to be read, the system usually derives the source selection from the target selection of such a field. However, the system cannot derive a source selection from field Group Currency. System Response It is possible that a greater volume of source data is being read than is necessary. This can lead to performance issues. Procedure Check whether a mapping rule is defined for field Group Currency. If a mapping rule is defined, you can disregard this warning message. However, if you discover after method execution that the system did not process a large amount of data, and that system performance was not satisfactory, you may want to examine the source selection by choosing the Source button in the log. If the reason for the disregarded data is that too much source data was read because of the unrestricted selection on the source field (which is linked with target field Group Currency through mapping), choose one of the alternatives below: Change the mapping rule for field Group Currency so that the system can derive a delimiting source selection. Implement the Business Add-In (BAdI) UC_DATATRANSFER with the method INVERT to delimit the selection for the source field that is linked via mapping to the target field Group Currency
    1 is incompatible with input format for field FISCPERIOD Message no. UCT8258 Diagnosis During execution, the method derives the source selection for source field FISCPERIOD from the mapping rule for the target field. 1 is one of the values that were derived for the source selection. The system requires that this value is in the correct SAP-internal format because the Conversion Exit indicator has been selected in the move operator for field FISCPERIOD. However, the value 1 is incompatible with the SAP-internal format. System Response The system attempts to interpret value 1 as an external format and convert it to the internal format. If this fails, the system is unable to restrict the source selection using source field FISCPERIOD. In this case, the system may read more source data than was originally intended, which can affect performance. Procedure In the log, choose the Source button to display the source selections that are used to read the source data. When this appears, examine values selected for field FISCPERIOD. If the correct values were selected, you can ignore this message. To prevent this message from being issued, you can select the indicator in the mapping rule used by source field FISCPERIOD. If incorrect values were selected, make sure that the mapping rule used by source field FISCPERIOD has been defined correctly. If the mapping rule is correct and value (1) derived for the source selection does not affect the overall result, you can ignore this message. If the source selection does not contain the value 1 for field FISCPERIOD and, because of this, source data that is supposed to be read is not being read, make sure that the mapping rule has been defined correctly. If the source selection does not contain any value for field FISCPERIOD, make an estimation as to how much excess source data is being read and whether this might affect system performance. If you do not expect any performance problems, you can ignore this message. In any event, you have the following alternatives if the mapping rule is defined correctly, but the source selection on field FISCPERIOD is unsatisfactory: You can define a source selection for field FISCPERIOD in the Customizing settings for the method on the Selection tab page. Then the method uses this source selection instead of the source selection derived from inverse interpretation of the mapping rule. You can implement the Business Add-In (BAdI) UC_DATATRANSFER and use the method INVERT to determine the source selection on field FISCPERIOD. Then the method uses the result of the INVERT method for the source selection instead of the source selection derived from inverse interpretation of the mapping rule
    Input must be in the format ___,___,__~ Message no. 00088 Diagnosis Your entry does not match the specified input format. System Response The entry in this field was rejected. Procedure The entry must comply with the edit format. The following edit format characters have a special meaning: "_" (underscore) There should be an input character at this point; this should be a number for numeric fields. "." (decimal point) (applies to numeric fields) The decimal point occurs here (setting in the user master record). "," (thousands separator) (applies to numeric fields) This separator occurs (optionally) for more than three figures. Depending on the setting in the user master record, it can be a period or a comma. "V" (applies to numeric fields) The operational sign appears here. If used, it must by at the right margin of the field. The sign is either "-" or " "(space). "~" (tilde) (applies to numeric fields) As of and including this character, leading zeros must also be entered. Otherwise, this character has the same meaning as an underscore. Leading zeros need not be entered on the left of the tilde. They are not output at this position. All other characters have their normal meanings and must be entered in the same position as in the edit format.

    Hi Dan,
    Could you Kiindly advise me where we need to write the Mapping Rules in Consolidation Monitor? All he time the errors refering to Mapping Rules. The only Tab I seen "Mapping" is in Data Basis But as per my Understanding Iwe do not have much to do there as it is system generated Mapping Tab.
    Where we actually go and select/deselct those Input Conversion Indicator/ Conversion exit Indicator.
    Highly appreciate your advise.
    Thanks and Regards,
    BIP

  • What is Part Number

    Hi All,
    What is Part number. When I print GR/GI slip, its appearing. From where systems picking this Part number.
    Regards,
    Sureshbabu G.

    Hi suresh ,
    Inventory-Managed Manufacturer Part Number
    Purpose
    Manufacturers can identify their parts uniquely and regulate the use of interchangeable parts in their parts catalogs. Inventory-Managed Manufacturer Part Number (IM-MPN) belongs to the component Manufacturer Part Number (IS-AD-MPN) and includes the following features:
    ·        Identification of parts using the manufacturer part number (MPN) issued by the manufacturer
    The system finds, identifies, and displays these parts using the unique combination of manufacturer-specific details ‑ the Manufacturer Part Number (MPN) and the External Manufacturer. These parts are inventory-managed manufacturer parts, and are maintained with a complete material master record and their own stock.
    ·        Management of part interchangeability
    The system recognizes parts from different manufacturers that have the same technical properties and are interchangeable in Purchasing, Inventory Management, MRP, and the Availability Check, as being interchangeable; these parts have their own stock. The management of part interchangeability includes:
    ¡        Inventory-managed manufacturer parts that are fully interchangeable with each other are grouped in a common class of interchangeable parts - a form-fit-function class (FFF class).
    ¡        You can group fully interchangeable parts of an FFF class in MPN-MRP sets subject to plant and planning area. The system treats these parts are treated as fully interchangeable parts in planning, inventory management, and the availability check.
    ¡        Restricted or one-way interchangeable parts cannot belong to the same FFF class. You use interchangeability codes to group these parts. Restricted interchangeability is available for all processes that support MPN. These processes are:
    §         Sales order product selection
    §         Sales rescheduling reports
    §         ATP check for components in PM/CS order
    §         General availability check
    §         Goods receipt in transaction code MIGO
    §         Stock overview
    §         Stock transport order
    §         Configuration control
    Integration
    The functions for Inventory-Managed Manufacturer Part Number are fully integrated with the components for Purchasing, Material Requirements Planning, and Sales and Distribution.
    These functions supplement the functions for the non-inventory-managed manufacturer part number (MPN), which are available in the standard system as of Release 4.0. These functions contain a special material type (HERS), and an Approved Manufacturersu2019 Part List (AMPL). You can define different manufacturer parts as interchangeable by grouping their material masters in an internal material master.
    Catalog Content Management (CCM) 1.0 supports the use of concatenated manufacturer part numbers.
    Features
    The functions include:
    ·        Master Data Maintenance
    Maintenance and display of full and restricted interchangeability, as well as maintenance of MPN-MRP sets.
    ·        Input and Output Conversion of Material Numbers
    The input conversion of material numbers allows you to enter the MPN and the external manufacturer instead of the SAP material number.
    The output conversion ensures that the system outputs the MPN and external manufacturer in lists and on the screen instead of the SAP material number.
    ·        Interchangeable Manufacturer Parts in Purchasing
    When processing quotations and purchase orders, you may have to exchange the part in the current process with another part, because you have received a quotation, notification, or delivery for an alternative part. The system supports you in changing and allocating the relevant order items so that the follow-on steps (in particular, goods receipt and invoice verification) refer to the part that was actually delivered.
    ·        Interchangeable Manufacturer Parts in MRP
    There is a risk that inventory management on the MPN level could cause an excess of stock if the system does not take account of the interchangeability of parts. Therefore, in material requirements planning, the system takes account of the interchangeability of the parts to be procured, and ensures that a part is not ordered if another fully interchangeable part is in stock.
    ·        Interchangeable Manufacturer Parts in Inventory Management
    The system holds different manufacturer parts in stock as separate parts. This gives you an overview of the manufacturer parts that are actually available, and allows the system to manage additional information, such as serial numbers or valuation. Cumulative analysis of interchangeable parts is also possible.
    ·        Interchangeable Manufacturer Parts in the Availability Check
    If a part is not available, the availability check in PM orders and production orders also takes account of interchangeable parts.
    ·        Creation of subitems in stock transport orders. For more information, see Interchangeable Manufacturer Parts in the Availability Check and Interchangeability in Stock Transport Orders.
    ·        Goods movement using transaction code MIGO. You can interchange parts in the following:
    ¡        Goods issue for the stock transport order
    ¡        Goods receipt for the purchase order
           Goods issue for the reservation
    Hope it is usefull for you .
    Thanks
    srinivas

  • Regarding ESS Addresses application

    Hi,
    We are using EP 7.0 and implemented ESS/MSS.
    Now they have activated Com01, Num01 fields of Infotype 6(Adresses).
    But these fields are not visible in the Addresses application of ESS.
    For example if I add these entries in Permanent address type, these fields are not displayed in Portal,
    Is there any configuration available in the ECC to make these fields visible in portal ESS application also since these fields are standard or do we need to go for customization.
    Any idea on this will be highly appreciated.
    Thanks and Regards,
    Vivek.

    Hi,
    In order to add the required fields in the ESS Addresses application,  we need to add those fields in the following structure of the country specific function module HRXSS_PER_EDIT_P0006_XX where XX u2013 defines the country code(say de- germany, fr-france) 
    Structure: HCMT_BSP_PA_XX_R0006  where again XX u2013 defines the country code
    After changing the structure you need to restart the portal for this to reflect and use the below mentioned link.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?spaceKey=profile&title=ESSPersonalInformationUIenhancementwithoutmodification&decorator=printable
    After that you need to enhance the BADI   HRPAD00INFTYUI   for the input conversion ans output conversion.
    Please let me know for further clarification.
    Regards,
    Vivek,

  • Dd-mm-yyyy to yyyymmdd

    hi all,
    plz tell me the FM to convert dd-mm-yyyy to yyyymmdd.
    regards
    puneet

    Chk this any one will help you,
    CONVERSION_EXIT_PDATE_INPUT                         Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
    CONVERSION_EXIT_IDATE_INPUT              External date INPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_SDATE_INPUT              External date (e.g. 01.JAN.1994) INPUT conversion exit
    CONVERT_DATE_INPUT                       Conversion of a date from external to internal format
    CONVERSION_EXIT_PDATE_OUTPUT             Conversion Exit for Domain GBDAT: YYYYMMDD  -> DD/MM/YYYY
    CONVERSION_EXIT_IDATE_OUTPUT             External date OUTPUT conversion exit (e.g. 01JAN1994)
    CONVERSION_EXIT_LDATE_OUTPUT         Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    CONVERSION_EXIT_SDATE_OUTPUT         Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    CALCULATE_DATE : Calculates the future date based on the input .
    DATE_TO_DAY : Returns the Day for the entered date.
    DATE_COMPUTE_DAY : Returns weekday for a date
    DATE_GET_WEEK : Returns week for a date
    RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
    MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    MONTH_NAMES_GET : Get the names of the month
    WEEK_GET_FIRST_DAY : Get the first day of the week
    HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format
    SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
    L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
    HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
    LAST_DAY_OF_MONTHS : Returns the last day of the month
    DATE_CHECK_PLAUSIBILITY :Check for the invalid date.
    DATE_2D_TO_4D_CONVERSION :Year entry: 2-character to 4-character.
    DAY_IN_WEEK :Input date and will give the name of the day 1-monday,2-Tuesday....
    SD_DATETIME_DIFFERENCE : Give the difference in Days and Time for 2 dates
    regards,
    Prabhu

  • Handle data type like CURR in generic table

    HI ALL
    I'm working on daynamic structure <ls_attributes>  and the values of fields are type string  lsmapping-field_value_
    here in the code i try to fill structure <ls_attributes> with acatul values from it_mapping.
    This is the code that im using
    io_node->get_attributes(
        IMPORTING
          es_attributes =  <ls_attributes>  ).
    LOOP AT it_mapping INTO ls_mapping .
        ASSIGN COMPONENT ls_mapping-tar_field OF STRUCTURE <ls_attributes>
        TO <lo_attr>.
        IF sy-subrc = 0.
          <lo_attr> = ls_mapping-field_value.
        ENDIF.
      ENDLOOP.
    the problem here that when i try to move value like 300.000.000,00 i get the following error .
    The program attempted to interpret the value "300.000.000,00" as a number, but
    since the value contravenes the rules for correct number formats,
    this was not possible.
    Any idea how can convert these string type to type like  KNA1-UMSA1  ?
    or string with value time like 04:29:31 with datatype USCHANGE-MODTI since the field is type T(6)
    and when i put there string i am getting 04:29: the second 31 is omited
    The main problem here is how to convert string with any value to
    the respective type <lo_attr> ,if its time, date, curr etc in  <ls_attributes> i get empty structure with the type of the fields (as field symbol )  
    Best regards
    Alex
    Edited by: Alex Dean on Dec 5, 2010 8:03 PM

    Hi Alex,
    SAP/ABAP works with implicit input/output conversion handled by screen processor for input and by WRITE statement for output.
    The external representation of a currency value, i.e. "1.000.000,00" (depending on user settings) is converted to internal representation ""1000000.00" by screen processor.
    If it does not go through screen, no implicit input conversion takes place and you get the dump as described.
    Editable ALV has just this problem because ALV cells are character fields of length 255. That's why SAP created a generic function module for this. The function module will determine the internal datatype of the field passed to parameter output_internal  and convert accordingly.
    In your case you should pass the currency key as well because the internal representation is different for different number of decimals.
    CALL FUNCTION 'RS_CONV_EX_2_IN'
        EXPORTING
          input_external                     = ls_mapping-field_value
          table_field                        = ls_tabfield
    *   CURRENCY                           = CURRENCY
        IMPORTING
          output_internal                    = <lo_attr>
        EXCEPTIONS
          input_not_numerical                = 1
          too_many_decimals                  = 2
          more_than_one_sign                 = 3
          ill_thousand_separator_dist        = 4
          too_many_digits                    = 5
          sign_for_unsigned                  = 6
          too_large                          = 7
          too_small                          = 8
          invalid_date_format                = 9
          invalid_date                       = 10
          invalid_time_format                = 11
          invalid_time                       = 12
          invalid_hex_digit                  = 13
          unexpected_error                   = 14
          invalid_fieldname                  = 15
          field_and_descr_incompatible       = 16
          input_too_long                     = 17
          no_decimals                        = 18
          invalid_float                      = 19
          conversion_exit_error              = 20
          OTHERS                             = 21
      IF sy-subrc = 0.
        rv_value = <inputt>.
      ENDIF.
    Regards,
    Clemens

  • RFBIBL00 Flat File Creation issue

    Hello All,
    I'm using "RFBIBL00" to post the FI documents, and the input to the FB01 transaction screen is obtained from a flat file from AL11 directory.
    The issue here is regarding the date format of the Document date and Posting date. If the date format is as YYYYMMDD in the flat file, and if I'm using the date parameter (in the default option of one's SAP own data) other than starting with YYYY, the document is not getting posted and it is throwing error saying that date format is not correct. If I have chosen the date format starting with YYYY, then the document is getting posted successfully.
    Any suggestions/ideas to make the date format as independent?
    Thanks,
    Bharath.

    Hi Bharath
    I think you'll have to use the appropriate conversion exit for the same. Choose from the below options which suit you.
    SAP Internal format is 'YYYYMMDD' Example: '19990123'
    1. CONVERT_DATE_TO_EXTERNAL
    2. CONVERT_DATE_TO_INTERNAL
    3. CONVERSION_EXIT_PDATE_INPUT Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
    4. CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY
    5. CONVERSION_EXIT_IDATE_INPUT External date INPUT conversion exit
    6. CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit
    7. CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    8. CONVERSION_EXIT_SDATE_INPUT External date (e.g. 01.JAN.1994) INPUT conversion exit
    9. CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
    The date coming in from the flat file will certainly tick to one particular format i guess.
    Hope this helps.
    Harsh

Maybe you are looking for