Not mutually convertible structure and itab

Hi All,
I have defined a structure struct with table ekpo and itab with include structure ekpo.
Itab :
DATA: BEGIN OF ITAB OCCURS 10.
            INCLUDE STRUCTURE EKPO.
END OF ITAB.
and Struct
DATA: BEGIN OF STRUCT.
        INCLUDE STRUCTURE EKPO.
      END OF STRUCT.
Before "Move itab to struct" used to work fine. But now I have enabled the unicodes check, and it gives me error of mutually not convertible structures.
Can someone guide me of a work around ?
thanks,

Hi
I'm using release ecc 6.00 with unicode system and this statament works fine:
DATA: BEGIN OF ITAB OCCURS 10.
        INCLUDE STRUCTURE EKPO.
data: END OF ITAB.
DATA: BEGIN OF STRUCT.
        INCLUDE STRUCTURE EKPO.
data: END OF STRUCT.
start-of-selection.
  move itab to struct.
If u can't do it u can try to change the definition of your structure:
DATA: ITAB TYPE TABLE OF EKPO WITH HEADER LINE
DATA: STRUCT TYPE EKPO.
and/or use the field-symbol to transfer the value:
field-symbols: <wa_in>  type any,
                 <wa_out> type any.
  do.
    assign component sy-index of structure itab to <wa_in>.
    if sy-subrc <> 0. exit. endif.
    assign component sy-index of structure struct to <wa_out>.
    <wa_out> = <wa_in>.
  enddo.
Max
Edited by: max bianchi on Oct 7, 2008 12:27 PM

Similar Messages

  • UCCHECK error in upgrade: Data type and structure not mutually convertible.

    Hi ABAPers,
    We have upgraded our system from 4.6c to ECC 6.0. We are at the unicode check stage. I am getting an error " 'V_LEV' and 'T_RES_TOTALS' are not mutually convertible in a Unicode program."
    The structure of T_RES_TOTALS is like this:
    BEGIN OF T_RES_TOTALS OCCURS 0,
        FLD1TEXT    LIKE ZTQ_REPVAL-VTEXT,
        FLD1        LIKE ZTQ_VBKA-ZZREP_FLD1,
        FLD2TEXT    LIKE ZTQ_REPVAL-VTEXT,
        FLD2        LIKE ZTQ_VBKA-ZZREP_FLD2,
        FLD3TEXT    LIKE ZTQ_REPVAL-VTEXT,
        FLD3        LIKE ZTQ_VBKA-ZZREP_FLD3,
        FLD4TEXT    LIKE ZTQ_REPVAL-VTEXT,
        FLD4        LIKE ZTQ_VBKA-ZZREP_FLD4,
        FLD5TEXT    LIKE ZTQ_REPVAL-VTEXT,
        FLD5        LIKE ZTQ_VBKA-ZZREP_FLD5,
        FLD6TEXT    LIKE ZTQ_REPVAL-VTEXT,
        FLD6        LIKE ZTQ_VBKA-ZZREP_FLD6,
        VTEXT    LIKE ZTQ_SRCET-TXT,
        SOURCE    LIKE ZTQ_SRCET-SOURCE,
        NAME1    LIKE KNA1-NAME1,
        RAREA     LIKE KNA1-KUNNR,
        TOTAL     TYPE I,
        LEV(2)      TYPE N,
      END OF T_RES_TOTALS,
    V_LEV is declared as this:
    V_LEV(2)      TYPE N,
    Below is the code and the line (marked in bold) which gives the error:
    LOOP AT T_RES_TOTALS.
        *V_LEV = T_RES_TOTALS.*
        AT NEW FLD1.      PERFORM FLD1_START.    ENDAT.
        AT NEW FLD2.      PERFORM FLD2_START.    ENDAT.
        AT NEW FLD3.      PERFORM FLD3_START.    ENDAT.
        AT NEW FLD4.      PERFORM FLD4_START.    ENDAT.
        AT NEW FLD5.      PERFORM FLD5_START.    ENDAT.
        AT NEW FLD6.      PERFORM FLD6_START.    ENDAT.
        AT NEW SOURCE.    PERFORM SOURCE_HEADER. ENDAT.
        AT END OF RAREA.  PERFORM RES_AREA_LINE. ENDAT.
        AT END OF SOURCE. PERFORM SOURCE_TOTAL.  ENDAT.
        AT END OF FLD6.   PERFORM FLD6_END.      ENDAT.
        AT END OF FLD5.   PERFORM FLD5_END.      ENDAT.
        AT END OF FLD4.   PERFORM FLD4_END.      ENDAT.
        AT END OF FLD3.   PERFORM FLD3_END.      ENDAT.
        AT END OF FLD2.   PERFORM FLD2_END.      ENDAT.
        AT END OF FLD1.   PERFORM FLD1_END.      ENDAT.
      ENDLOOP.

    write as below ...
    LOOP AT T_RES_TOTALS.
        V_LEV = T_RES_TOTALS-LEV.  <----
      AT NEW FLD1.      PERFORM FLD1_START.    ENDAT.
        AT NEW FLD2.      PERFORM FLD2_START.    ENDAT.
        AT NEW FLD3.      PERFORM FLD3_START.    ENDAT.
        AT NEW FLD4.      PERFORM FLD4_START.    ENDAT.
        AT NEW FLD5.      PERFORM FLD5_START.    ENDAT.
        AT NEW FLD6.      PERFORM FLD6_START.    ENDAT.
        AT NEW SOURCE.    PERFORM SOURCE_HEADER. ENDAT.
        AT END OF RAREA.  PERFORM RES_AREA_LINE. ENDAT.
        AT END OF SOURCE. PERFORM SOURCE_TOTAL.  ENDAT.
        AT END OF FLD6.   PERFORM FLD6_END.      ENDAT.
        AT END OF FLD5.   PERFORM FLD5_END.      ENDAT.
        AT END OF FLD4.   PERFORM FLD4_END.      ENDAT.
        AT END OF FLD3.   PERFORM FLD3_END.      ENDAT.
        AT END OF FLD2.   PERFORM FLD2_END.      ENDAT.
        AT END OF FLD1.   PERFORM FLD1_END.      ENDAT.
      ENDLOOP.

  • Are not mutually convertible in a Unicode program

    Hi guys,
    I'm getting error: "LS_EDIDD-SDATA and LS_STRUCTURE are not mutually convertible in Unicode Program"
    I have PRKST which is Amount field in LS_STRUCTURE, which causes this problem.
    But if I change type of PRKST to CHAR15, then it doesn't give error.
    But i want to use this field with type PRKST( CURR 11, decimal places 2).
    Please help. Its urgent.
    Thanks,
    Mehul Lad
    Moderator message - "Urgency" is not allowed in the forums. Read the RoE.
    Message was edited by: Suhas Saha

    Hi,
    LCHR field is not a standalone field. It is always preceded by a field of type INT2 which has the length of the data stored in LCHR field.
    So, in structure LS_EDIDD there should be a INT2 type field just before the field SDATA which tells the length of the actual value in SDATA. Suppose the field name is LEN.
    So,
    assign the value like this :
    LS_STRUCTURE = LS_EDIDD-SDATA(LS_EDIDD-LEN).
    Regards,
    Ashish

  • Not mutually convertible

    Hello experts,
    When I import the following paragraph of code from non-unicode system to unicode system, I met a problem related to 'not mutually convertible'.
         L_T_TEST[] = T_INDX[].
          LOOP AT L_T_TEST ASSIGNING <F_TEST>.
            <F_TEST>-ZUNAME = SY-UNAME.
            <F_TEST>-ZDATUM  = SY-DATUM.
            <F_TEST>-ZTIMLO    = SY-TIMLO.
          ENDLOOP.
          T_INDX[] = L_T_TEST[].
    T_INDX STRUCTURE  INDX.
    L_T_TEST like other structure(structure A).
    <F_TEST> refer to the same structure as L_T_TEST.
    Structure A is totally different from table INDX, so in unicode system this paragraph of code is not allowed.
    Notes: Field CLUSTD in table INDX is quite especial.
    Could anyone help me?
    Thanks & Best regards,
    Christina

    Hi,
    as the structures L_T_TEST and T_INDX are different u cannot move directly...in the new SAP version...in order to achieve ur functionality u have to move field by field to it..try like this
    Assuming field1 ,field2 and field3 are thre in both the tables.
    LOOP AT L_T_TEST .
    move :L_T_TEST -field1 to t_indx-field1,
              L_T_TEST -field2 to t_indx-field2,
              L_T_TEST -field3 to t_indx-field3.
    append t_indx.
    endloop.
    Regards,
    Nagaraj

  • Error -not mutually convertible in a Unicode program

    Hi all,
              I have declare my internal table and workarea as below ...     
    TYPES: BEGIN OF t_mara,
            matnr type mara-matnr,
           END OF t_mara.
    DATA : it_mara TYPE t_mara OCCURS 0 WITH HEADER LINE.
    DATA :wa_mara like  mara-matnr.
    when iam loopimg my internal table into work area(like loop at it_mara into wa_mara ......) .. iam getting below error
    A line of "IT_mara" and "wa_mara" are not mutually convertible in a Unicode program. Unicode program.          
    Can any one let me know what is the exact problem ?..
    Thanks
    MAHA

    Hi Maha,
    pls see the declaration as below..it is working..
    TYPES: BEGIN OF t_mara,
    matnr type mara-matnr,
    END OF t_mara.
    DATA : it_mara TYPE t_mara OCCURS 0 WITH HEADER LINE.
    DATA :wa_mara like line of it_mara.
    Keerthi.

  • Field catalog & internal table are not mutually convertible

    Hi friends,
              please help me for this problem, actually i m trying to display three alv reports from the three buttond i have given on my first basic report. its working fine till first & getting the data into the internal table for the second also. but when coming to the field catalog for the second report its giving syntax error as my "field catalog and internal table are not mutually convertible'".i have tried by giving different fieldcatalog also but its giving the same problem.please help for this & try to give an example if u can. Thanks a lot.
    Regards
    Pankaj

    This is my code :
    TABLES: PLAF,
            MARA,
            MAKT,
            AFPO,
            T023T,
            VSAUFK,
            T006A,
            MBEW,
            ZCDR_D.
    Type Pools for ALV *************************
    TYPE-POOLS: SLIS,
                ABAP.
               KKBLO.
    DATA DECLARATION.  ****************************
    DATA: FLAG TYPE I,
          FLAG1 TYPE I,
          FLAG2 TYPE I,
          FLAG3 TYPE I,
          FLAG4 TYPE I,
          FLAG5 TYPE I.
    ********Declaration for field catalog
    DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          LAYOUT1 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV,
          LAYOUT2 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT2 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT2 TYPE SLIS_FIELDCAT_ALV,
          LAYOUT3 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT3 TYPE SLIS_FIELDCAT_ALV.
    TYPES DECLARATION.  ****************************
    TYPES: BEGIN OF TY_MARA,
           MATNR LIKE MARA-MATNR,                  " Material Number
           MATKL LIKE MARA-MATKL,                  " Material Group
           END OF TY_MARA.
    TYPES: BEGIN OF TY_PLAF,
           PERTR LIKE PLAF-PERTR,                  " Date
           PLNUM LIKE PLAF-PLNUM,                  " Planned Order Number
           MATNR LIKE PLAF-MATNR,                  " Material number
           PLWRK LIKE PLAF-PLWRK,                  " Plant
           KDAUF LIKE PLAF-KDAUF,                  " Sales Order Number
           KDPOS LIKE PLAF-KDPOS,                  " SO Line Item
           END OF TY_PLAF.
    TYPES: BEGIN OF TY_MAKT,
           MATNR LIKE PLAF-MATNR,                  " Material Number
           MAKTX LIKE MAKT-MAKTX,                  " Material Description
           END OF TY_MAKT.
    TYPES: BEGIN OF TY_AFPO,
           PLNUM LIKE AFPO-PLNUM,                  " Planned Order Number
           MATNR LIKE AFPO-MATNR,                  " Material Number
           KDAUF LIKE AFPO-KDAUF,                  " Sales Order Number
           KDPOS LIKE AFPO-KDPOS,                  " SO Line Item
           AUFNR LIKE AFPO-AUFNR,                  " Production Order
           STRMP LIKE AFPO-STRMP,
           DWERK LIKE AFPO-DWERK,
           END OF TY_AFPO.
    TYPES: BEGIN OF TY_ZCDR_D,
           MANDT LIKE ZCDR_D-MANDT,                " Client
           CBNO LIKE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE ZCDR_D-PLNUM,                " Planned Order Number
           MATNR LIKE ZCDR_D-MATNR,                " Material Number
           MAKTX LIKE ZCDR_D-MAKTX,                " Material Description
           KDAUF like ZCDR_D-KDAUF,                " Sales Order Number
           KDPOS like ZCDR_D-KDPOS,                " SO Line Item
           AUFNR LIKE ZCDR_D-AUFNR,                " Production Order
           END OF TY_ZCDR_D.
    TYPES: BEGIN OF TY_VSAUFK,
           INACT LIKE VSAUFK-INACT,                " Status Indicator
           END OF TY_VSAUFK.
    TYPES: BEGIN OF TY_PLAF_MAKT,
           CBNO LIKE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE PLAF-PLNUM,                  " Planned Order Number
           CHK TYPE C,                             " Check Box
           MATNR LIKE PLAF-MATNR,                  " Material Number
           MAKTX LIKE MAKT-MAKTX,                  " Material Description
           KDAUF LIKE PLAF-KDAUF,                  " Sales Order Number
           KDPOS LIKE PLAF-KDPOS,                  " SO Line Item
           AUFNR LIKE AFPO-AUFNR,                  " Production Order
           END OF TY_PLAF_MAKT.
    TYPES: BEGIN OF TY_HELP_ITEM,
           CBNO TYPE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE ZCDR_D-PLNUM,                " Planned Order Number
           MATNR LIKE ZCDR_D-MATNR,                " Material Number
           MAKTX LIKE ZCDR_D-MAKTX,                " Material Description
           KDAUF LIKE ZCDR_D-KDAUF,                " Sales Order Number
           KDPOS LIKE ZCDR_D-KDPOS,                " SO Line Item
           AUFNR LIKE ZCDR_D-AUFNR,                " Production Order
           END OF TY_HELP_ITEM.
    WORK AREA ******************************
    DATA: WA_MARA TYPE TY_MARA,
          WA_PLAF TYPE TY_PLAF,
          WA_MAKT TYPE TY_MAKT,
          WA_AFPO TYPE TY_AFPO,
          WA_ZCDR_D TYPE TY_ZCDR_D,
          WA_VSAUFK TYPE TY_VSAUFK,
          WA_PLAF_MAKT TYPE TY_PLAF_MAKT,
          WA_HELP_ITEM TYPE TY_HELP_ITEM.
    INTERNAL TABLES ****************************
    DATA: IT_MARA TYPE TABLE OF TY_MARA,
          IT_PLAF TYPE TABLE OF TY_PLAF,
          IT_MAKT TYPE TABLE OF TY_MAKT,
          IT_AFPO TYPE TABLE OF TY_AFPO,
          IT_ZCDR_D TYPE TABLE OF TY_ZCDR_D,
          IT_VSAUFK TYPE TABLE OF TY_VSAUFK,
          IT_PLAF_MAKT TYPE TABLE OF TY_PLAF_MAKT,
          IT_HELP_ITEM TYPE TABLE OF TY_HELP_ITEM.
    *it_events TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
    *WITH HEADER LINE INITIAL SIZE 0.
    TYPES: BEGIN OF TY_BOM,
              MATMK LIKE STPOX-MATMK,
              MTNRV LIKE ZCDR_D-MATNR,
              IDNRK LIKE STPOX-IDNRK,
              MNGLG LIKE STPOX-MNGLG,
              MMEIN LIKE STPOX-MMEIN,
             VPRSV LIKE STPOX-VPRSV,
              UPRICE LIKE MBEW-STPRS,
              TPRICE LIKE MBEW-STPRS,
            END OF TY_BOM,
            BEGIN OF TY_QUAN,
              MATMK LIKE STPOX-MATMK,
              MTNRV LIKE ZCDR_D-MATNR,
              IDNRK LIKE STPOX-IDNRK,
              MNGLG LIKE STPOX-MNGLG,
              MMEIN LIKE STPOX-MMEIN,
              UPRICE LIKE MBEW-STPRS,
              TPRICE LIKE MBEW-STPRS,
            END OF TY_QUAN,
            BEGIN OF TY_T023T,
              MATKL LIKE T023T-MATKL,
              WGBEZ LIKE T023T-WGBEZ,
            END OF TY_T023T,
            BEGIN OF TY_T006A,
              MMEIN LIKE T006A-MSEHI,
              MSEHT LIKE T006A-MSEHT,
            END OF TY_T006A,
            BEGIN OF TY_IMP_FINAL,
              SNO TYPE SY-INDEX,
              HSCODE LIKE ZHSCODE-HSCODE,
              WGBEZ TYPE T023T-WGBEZ,
              SPEC(20) TYPE C,
              MNGLG LIKE STPOX-MNGLG,
              MSEHT LIKE T006A-MSEHT,
              CNTRY(13) TYPE C,
              UPRICE TYPE P LENGTH 16 DECIMALS 2,
              TPRICE TYPE P LENGTH 16 DECIMALS 2,
              CURRCODE TYPE C LENGTH 5,
            END OF TY_IMP_FINAL,
            BEGIN OF TY_MBEW,
              MATNR LIKE MBEW-MATNR,
              VPRSV LIKE MBEW-VPRSV,
              STPRS LIKE MBEW-STPRS,
              VERPR LIKE MBEW-VERPR,
            END OF TY_MBEW.
      DATA: WA_BOM TYPE TY_BOM,
            WA_QUAN TYPE TY_QUAN,
            WA_IMP_FINAL TYPE TY_IMP_FINAL,
            WA_T023T TYPE TY_T023T,
            WA_T006A TYPE TY_T006A,
            WA_MBEW TYPE TY_MBEW.
      DATA: IT_BOM TYPE TABLE OF TY_BOM,
            IT_QUAN TYPE TABLE OF TY_QUAN,
            IT_IMP_FINAL TYPE TABLE OF TY_IMP_FINAL,
            IT_MBEW TYPE TABLE OF TY_MBEW.
    SELECTION-SCREEN **************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : PR_CBNO LIKE ZCDR_D-CBNO OBLIGATORY.      "Customs Book number
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION  **************************
    INITIALIZATION.
    **PERFORM CLEAR_DATA.
    **CLEAR: wa_layout.
    *PERFORM set_events USING it_events[].
    SELECT OPTION ****************************************
    SELECTION-SCREEN : BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS:
            SO_PERTR for PLAF-PERTR,              "----
    Date
            SO_MATNR for MARA-MATNR,              "----
    Material
            SO_MATKL for MARA-MATKL,              "----
    Material Group
            SO_PLWRK for PLAF-PLWRK OBLIGATORY,   "----
    Plant
            SO_KDAUF for PLAF-KDAUF.              "----
    Sales Order
    SELECTION-SCREEN : END OF BLOCK BLK.
    SELECTION SCREEN F4 HELP  *********************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_CBNO.
    DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
          DYNFIELDS-FIELDNAME = PR_CBNO.
          APPEND DYNFIELDS.
         CALL FUNCTION 'DYNP_VALUES_READ'
              EXPORTING
                    DYNAME                               = SY-CPROG
                    DYNUMB                               = SY-DYNNR
                    TRANSLATE_TO_UPPER                   = 'X'
                  REQUEST                              = ' '
                  PERFORM_CONVERSION_EXITS             = ' '
                  PERFORM_INPUT_CONVERSION             = ' '
                  DETERMINE_LOOP_INDEX                 = ' '
                  START_SEARCH_IN_CURRENT_SCREEN       = ' '
                  START_SEARCH_IN_MAIN_SCREEN          = ' '
                  START_SEARCH_IN_STACKED_SCREEN       = ' '
                  START_SEARCH_ON_SCR_STACKPOS         = ' '
                  SEARCH_OWN_SUBSCREENS_FIRST          = ' '
                  SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
              TABLES
                    DYNPFIELDS                           = DYNFIELDS
              EXCEPTIONS
                    INVALID_ABAPWORKAREA                 = 1
                    INVALID_DYNPROFIELD                  = 2
                    INVALID_DYNPRONAME                   = 3
                    INVALID_DYNPRONUMMER                 = 4
                    INVALID_REQUEST                      = 5
                    NO_FIELDDESCRIPTION                  = 6
                    INVALID_PARAMETER                    = 7
                    UNDEFIND_ERROR                       = 8
                    DOUBLE_CONVERSION                    = 9
                    STEPL_NOT_FOUND                      = 10
                     OTHERS                               = 11
            IF SY-SUBRC <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
         READ TABLE DYNFIELDS WITH KEY FIELDNAME = 'CBNO'.
            PR_CBNO = DYNFIELDS-FIELDVALUE.
            SELECT
                CBNO
                PLNUM
                MATNR
                MAKTX
                KDAUF
                KDPOS
                AUFNR
                FROM ZCDR_D
                INTO TABLE IT_HELP_ITEM .
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
        DDIC_STRUCTURE         = ' '
          RETFIELD               = 'CBNO'
        PVALKEY                = ' '
         DYNPPROG               = SY-CPROG
         DYNPNR                 = SY-DYNNR
         DYNPROFIELD            = 'PR_CBNO'
        STEPL                  = 0
        WINDOW_TITLE           =
        VALUE                  = ' '
         VALUE_ORG              = 'S'
        MULTIPLE_CHOICE        = ' '
        DISPLAY                = ' '
        CALLBACK_PROGRAM       = ' '
        CALLBACK_FORM          = ' '
        MARK_TAB               =
      IMPORTING
        USER_RESET             =
        TABLES
          VALUE_TAB              = IT_HELP_ITEM
        FIELD_TAB              =
        RETURN_TAB             =
        DYNPFLD_MAPPING        =
      EXCEPTIONS
        PARAMETER_ERROR        = 1
        NO_VALUES_FOUND        = 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.
    ***********************SELECTION SCREEN VALIDATION.*******************
    AT SELECTION-SCREEN ON PR_CBNO.
      SELECT SINGLE *
      FROM ZCDR_D
      WHERE CBNO = PR_CBNO.
      IF SY-SUBRC EQ 0.
        MESSAGE E000(ZCBR) WITH PR_CBNO.
      ENDIF.
    AT SELECTION-SCREEN ON SO_PERTR.
      IF SO_PERTR IS NOT INITIAL.
        SELECT SINGLE *
        FROM PLAF
        WHERE PERTR IN SO_PERTR.
        IF SY-SUBRC NE 0.
          MESSAGE W001(ZCBR) WITH SO_PERTR-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_MATNR.
      IF SO_MATNR IS NOT INITIAL.
        SELECT SINGLE *
          FROM MARA
          WHERE MATNR IN SO_MATNR.
        IF SY-SUBRC NE 0.
          MESSAGE W002(ZCBR) WITH SO_MATNR-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_MATKL.
      IF SO_MATKL IS NOT INITIAL.
        SELECT SINGLE *
          FROM MARA
          WHERE MATKL IN SO_MATKL.
        IF SY-SUBRC NE 0.
          MESSAGE W003(ZCBR) WITH SO_MATKL-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_PLWRK.
      IF SO_PLWRK IS NOT INITIAL.
        SELECT SINGLE * FROM PLAF
          WHERE PLWRK IN SO_PLWRK.
        IF SY-SUBRC NE 0.
          MESSAGE W004(ZCBR) WITH SO_PLWRK-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_KDAUF.
      IF SO_KDAUF IS NOT INITIAL.
        SELECT SINGLE * FROM PLAF
        WHERE KDAUF IN SO_KDAUF.
        IF SY-SUBRC NE 0.
          MESSAGE W005(ZCBR) WITH SO_KDAUF-LOW.
        ENDIF.
      ENDIF.
    *********************START-OF-SELECTION.*****************************
    START-OF-SELECTION.
      IF so_pertr IS NOT INITIAL.
        FLAG = 1.
      ENDIF.
      IF SO_MATNR IS NOT INITIAL.
        FLAG1 = 1.
      ENDIF.
      IF so_matkl IS NOT INITIAL.
        FLAG2 = 1.
      ENDIF.
      IF so_plwrk IS NOT INITIAL.
        FLAG3 = 1.
      ENDIF.
      IF so_kdauf IS NOT INITIAL.
        FLAG4 = 1.
      ENDIF.
       Select data into its internal table from different database tables
      SELECT
        MATNR
        MATKL
       MTART
        INTO CORRESPONDING FIELDS OF TABLE IT_MARA
        FROM MARA
        WHERE MTART = 'ZFGS'.
      IF FLAG2 NE 0.
        DELETE IT_MARA WHERE
        NOT ( MATKL IN SO_MATKL )
      ENDIF.
      IF FLAG1 NE 0.
        DELETE IT_MARA WHERE
        NOT ( MATNR IN SO_MATNR )
      ENDIF.
      SELECT
         PERTR
         PLNUM
         MATNR
         PLWRK
         KDAUF
         KDPOS
         FROM PLAF
         INTO CORRESPONDING FIELDS OF TABLE IT_PLAF
         FOR ALL ENTRIES IN IT_MARA
         WHERE PLWRK IN SO_PLWRK
         AND MATNR = IT_MARA-MATNR.
        SELECT
          MATNR
          PLNUM
          AUFNR
          KDAUF
          KDPOS
          STRMP
          DWERK
        INACT
          FROM AFPO
          INTO CORRESPONDING FIELDS OF TABLE IT_AFPO
          FOR ALL ENTRIES IN IT_MARA
          WHERE DWERK IN SO_PLWRK
          AND MATNR = IT_MARA-MATNR.
         WHERE MATNR = IT_MARA-MATNR
         AND STRMP = IT_PLAF-PERTR
         AND KDAUF = IT_PLAF-KDAUF
         AND DWERK = IT_PLAF-PLWRK.
        End of Data selection
       Keep only those records which the user wants from his selection screen
      IF FLAG NE 0.
        DELETE IT_PLAF WHERE
        NOT ( PERTR IN SO_PERTR )
        DELETE IT_AFPO WHERE
        NOT ( STRMP IN SO_PERTR )
      ENDIF.
      IF FLAG3 NE 0.
        DELETE IT_PLAF WHERE
        NOT ( PLWRK IN SO_PLWRK )
        DELETE IT_AFPO WHERE
        NOT ( DWERK IN SO_PLWRK )
      ENDIF.
      IF FLAG4 NE 0.
        DELETE IT_PLAF WHERE
        NOT ( KDAUF IN SO_KDAUF )
        DELETE IT_AFPO WHERE
        NOT ( KDAUF IN SO_KDAUF )
      ENDIF.
        SELECT
         MATNR
         MAKTX
         FROM MAKT
         INTO CORRESPONDING FIELDS OF TABLE IT_MAKT
         FOR ALL ENTRIES IN IT_PLAF
         WHERE MATNR = IT_PLAF-MATNR
         AND SPRAS = 'EN'.
      SELECT
        FROM ZCDR_D
        INTO TABLE IT_ZCDR_D.
              Put data into final internal table from different internal tables
    LOOP AT IT_MARA INTO WA_MARA.
      LOOP AT IT_PLAF INTO WA_PLAF WHERE MATNR = WA_MARA-MATNR.
        READ TABLE IT_ZCDR_D
        INTO WA_ZCDR_D
        WITH KEY PLNUM = WA_PLAF-PLNUM.
        IF SY-SUBRC <> 0.
          MOVE WA_PLAF-PLNUM TO WA_PLAF_MAKT-PLNUM.
          MOVE WA_PLAF-MATNR TO WA_PLAF_MAKT-MATNR.
          MOVE WA_PLAF-KDAUF TO WA_PLAF_MAKT-KDAUF.
          MOVE WA_PLAF-KDPOS TO WA_PLAF_MAKT-KDPOS.
          READ TABLE IT_AFPO INTO WA_AFPO WITH KEY PLNUM = WA_PLAF-PLNUM.
              MOVE WA_AFPO-AUFNR TO WA_PLAF_MAKT-AUFNR.
           SELECT
             SINGLE * FROM VSAUFK
             INTO TABLE IT_VSAUFK
             WHERE AUFNR = WA_AFPO-AUFNR
             AND STAT = 'I0012'.
           IF SY-SUBRC <> 0.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
           ELSE.
             CHECK IT_VSAUFK-INACT = 'X'.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
           ENDIF.
        ENDLOOP.
             READ TABLE IT_MAKT
                INTO WA_MAKT
                WITH KEY MATNR = WA_MARA-MATNR.
                MOVE WA_MAKT-MAKTX TO WA_PLAF_MAKT-MAKTX.
                APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT.
                CLEAR WA_PLAF_MAKT.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    LOOP AT IT_PLAF_MAKT .
    LOOP AT IT_MARA INTO WA_MARA.
    LOOP AT IT_PLAF INTO WA_PLAF WHERE MATNR = WA_MARA-MATNR.
       LOOP AT IT_AFPO INTO WA_AFPO WHERE MATNR = WA_MARA-MATNR.
        READ TABLE IT_ZCDR_D
        INTO WA_ZCDR_D
        WITH KEY PLNUM = WA_AFPO-PLNUM.
        IF SY-SUBRC <> 0.
           LOOP AT IT_AFPO INTO WA_AFPO.
             WHERE MATNR IN SO_MATNR
             AND STRMP = SO_PERTR
             AND PLNUM IN SO_PLNUM
             AND KDAUF IN SO_-KDAUF
             AND MATKL IN SO_MATKL.
            SELECT
              SINGLE INACT FROM VSAUFK
              INTO WA_VSAUFK
              WHERE AUFNR = WA_AFPO-AUFNR
              AND STAT = 'I0012'.
            IF SY-SUBRC <> 0.
              WA_PLAF_MAKT-PLNUM = WA_AFPO-PLNUM.
              WA_PLAF_MAKT-KDAUF = WA_AFPO-KDAUF.
              WA_PLAF_MAKT-KDPOS = WA_AFPO-KDPOS.
              WA_PLAF_MAKT-MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-AUFNR = WA_AFPO-AUFNR.
              READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-MAKTX = WA_MAKT-MAKTX.
              APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT .
             APPEND WA_AFPO TO IT_PLAF_MAKT.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
            ELSE.
              CHECK WA_VSAUFK-INACT = 'X'.
              WA_PLAF_MAKT-PLNUM = WA_AFPO-PLNUM.
              WA_PLAF_MAKT-KDAUF = WA_AFPO-KDAUF.
              WA_PLAF_MAKT-KDPOS = WA_AFPO-KDPOS.
              WA_PLAF_MAKT-MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-AUFNR = WA_AFPO-AUFNR.
              READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-MAKTX = WA_MAKT-MAKTX.
              APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT .
             APPEND WA_AFPO TO IT_PLAF_MAKT.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
            ENDIF.
            ENDIF.
        ENDLOOP.
         EXIT.
       ENDIF.
      ENDLOOP.
    ENDLOOP.
      LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT.
        WA_PLAF_MAKT-CBNO = PR_CBNO.
        MODIFY IT_PLAF_MAKT FROM WA_PLAF_MAKT TRANSPORTING CBNO.
      ENDLOOP.
    ENDLOOP.
      PERFORM CHANGE_CATALOG.
      PERFORM ALV_DISPLAY.
    *&      Form  CHANGE_CATALOG
          text
    FORM CHANGE_CATALOG.
       LAYOUT-ZEBRA = 'X'.
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      WA_FIELDCAT-col_pos   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'Planned Order Nos.'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'PLNUM'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-INPUT = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'Check Box'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-CHECKBOX  = 'X'.
      WA_FIELDCAT-EDIT = abap_true.
      WA_FIELDCAT-FIELDNAME = 'CHK'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '12'.
      WA_FIELDCAT-SELTEXT_M = 'Material'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '35'.
      WA_FIELDCAT-SELTEXT_M = 'Material Description'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'MAKTX'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'Sales Order Number'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'KDAUF'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'S O Line Item'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'KDPOS'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '13'.
      WA_FIELDCAT-SELTEXT_M = 'Production Order'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'AUFNR'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
    *GS_LAYOUT-TOTALS_BEFORE_ITEMS = 'X'.
    *data : text like slis_ev_subtotal_text value 'total'.
    *gs_layout-subtotals_text = text.
    *gs_layout-totals_only = 'X'.
    gs_layout-subtotals_text = 'total'.
    endform. "  CHANGE_CATALOG
    *********************event*************************************
    *&      Form  ALV_DISPLAY
          text
    FORM ALV_DISPLAY.
    *data: LC_GLAY TYPE LVC_S_GLAY.
       LC_GLAY-EDT_CLL_CB = 'X'.
       gs_layout-colwidth_optimize = 'X'.
       gs_layout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                       I_INTERFACE_CHECK                 = ' '
                       I_BYPASSING_BUFFER                = ' '
                       I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
         I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
                       I_CALLBACK_TOP_OF_PAGE            = ' '
                       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
                       I_CALLBACK_HTML_END_OF_LIST       = ' '
                       I_STRUCTURE_NAME                  =
                       I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      = 'PLANNED ORDERS'
                       I_GRID_SETTINGS                   = LC_GLAY
        IS_LAYOUT                         = LAYOUT
         IT_FIELDCAT                       = IT_FIELDCAT[]
                       IT_EXCLUDING                      =
                       IT_SPECIAL_GROUPS                 =
                       IT_SORT                           =
                       IT_FILTER                         =
                       IS_SEL_HIDE                       =
                       I_DEFAULT                         = 'X'
        I_SAVE                            = 'X'
                       IS_VARIANT                        =
                       IT_EVENTS                         = IT_EVENTS[]
                       IT_EVENT_EXIT                     =
                       IS_PRINT                          =
                       IS_REPREP_ID                      =
                       I_SCREEN_START_COLUMN             = 0
                       I_SCREEN_START_LINE               = 0
                       I_SCREEN_END_COLUMN               = 0
                       I_SCREEN_END_LINE                 = 0
                       I_HTML_HEIGHT_TOP                 = 0
                       I_HTML_HEIGHT_END                 = 0
                       IT_ALV_GRAPHICS                   =
                       IT_HYPERLINK                      =
                       IT_ADD_IT_FIELDCAT                   =
                       IT_EXCEPT_QINFO                   =
                       IR_SALV_FULLSCREEN_ADAPTER        =
                     IMPORTING
                       E_EXIT_CAUSED_BY_CALLER           =
                       ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_PLAF_MAKT
                     EXCEPTIONS
                       PROGRAM_ERROR                     = 1
                       OTHERS                            = 2
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    REFRESH IT_FIELDCAT[].
    ENDFORM.                    "ALV_DISPLAY
    *&      Form  USER_COMMAND
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM USER_COMMAND
      USING UCOMM LIKE SY-UCOMM
      SELFIELD TYPE SLIS_SELFIELD.
      Data: REF1 TYPE REF TO CL_GUI_ALV_GRID.
    DATA WA LIKE LINE OF IT_PLAF_MAKT.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          E_GRID = REF1.
      CALL METHOD REF1->CHECK_CHANGED_DATA.
      CASE UCOMM.
        WHEN '&BACK'.
          LEAVE TO SCREEN 0.
        WHEN  '&EXIT'.
          LEAVE TO SCREEN 0.
        WHEN '&CANC'.
          LEAVE TO SCREEN 0.
        WHEN '&SAVE'.
          CLEAR IT_ZCDR_D[].
          LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT WHERE CHK = 'X'.
            CLEAR WA_ZCDR_D.
            WA_ZCDR_D-MANDT = SY-MANDT.
            WA_ZCDR_D-CBNO = WA_PLAF_MAKT-CBNO.
            WA_ZCDR_D-plnum = WA_PLAF_MAKT-PLNUM.
            WA_ZCDR_D-MATNR = WA_PLAF_MAKT-MATNR.
            WA_ZCDR_D-MAKTX = WA_PLAF_MAKT-MAKTX.
            WA_ZCDR_D-KDAUF = WA_PLAF_MAKT-KDAUF.
            WA_ZCDR_D-KDPOS = WA_PLAF_MAKT-KDPOS.
            WA_ZCDR_D-AUFNR = WA_PLAF_MAKT-AUFNR.
            APPEND WA_ZCDR_D to IT_ZCDR_D.
          ENDLOOP.
          LOOP AT IT_ZCDR_D INTO WA_ZCDR_D.
            INSERT ZCDR_D FROM WA_ZCDR_D.
            CLEAR WA_ZCDR_D.
          ENDLOOP.
          IF SY-SUBRC EQ 0.
            MESSAGE S021(ZCBR) WITH PR_CBNO.
          ENDIF.
          IF IT_ZCDR_D IS INITIAL.
            MESSAGE 'Select Atleast one Check Box' TYPE 'E' .
          ENDIF.
        WHEN 'IMPORT_INF'.
          PERFORM IMPORT_REPORT.
       WHEN 'EXPORT_INF'.
         PERFORM EXPORT_REPORT.
       WHEN 'UNIT_CONSU'.
         PERFORM UNIT_CONSUMPTION.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    FORM set_events USING it_events TYPE slis_t_event.
    DATA: x_event TYPE slis_alv_event.
    clear x_event.
    x_event-name = 'USER_COMMAND'.
    x_event-form = 'USER_COMMAND'.
    append x_event to it_events.
    CLEAR x_event.
    call function 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        I_LIST_TYPE           = 0
      IMPORTING
        ET_EVENTS             = IT_EVENTS
      EXCEPTIONS
        LIST_TYPE_WRONG       = 1
        OTHERS                = 2
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    read table it_events into x_event with key name = slis_ev_user_command.
          if sy-subrc = 0.
          x_event-form = 'USER_COMMAND'.
          modify it_events from x_event index sy-tabix transporting form .
          endif.
    ENDFORM.
    *&      Form  set_pf_status
          text
         -->RT_EXTAB   text
    FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'Z_PFSTAT'.
    ENDFORM.            " set_pf_status
    FORM IMPORT_REPORT.
    TYPES: BEGIN OF TY_BOM,
             MATMK LIKE STPOX-MATMK,
             MTNRV LIKE ZCDR_D-MATNR,
             IDNRK LIKE STPOX-IDNRK,
             MNGLG LIKE STPOX-MNGLG,
             MMEIN LIKE STPOX-MMEIN,
             VPRSV LIKE STPOX-VPRSV,
             UPRICE LIKE MBEW-STPRS,
             TPRICE LIKE MBEW-STPRS,
           END OF TY_BOM,
           BEGIN OF TY_QUAN,
             MATMK LIKE STPOX-MATMK,
             MTNRV LIKE ZCDR_D-MATNR,
             IDNRK LIKE STPOX-IDNRK,
             MNGLG LIKE STPOX-MNGLG,
             MMEIN LIKE STPOX-MMEIN,
             UPRICE LIKE MBEW-STPRS,
             TPRICE LIKE MBEW-STPRS,
           END OF TY_QUAN,
           BEGIN OF TY_T023T,
             MATKL LIKE T023T-MATKL,
             WGBEZ LIKE T023T-WGBEZ,
           END OF TY_T023T,
           BEGIN OF TY_T006A,
             MMEIN LIKE T006A-MSEHI,
             MSEHT LIKE T006A-MSEHT,
           END OF TY_T006A,
           BEGIN OF TY_IMP_FINAL,
             SNO TYPE SY-INDEX,
             HSCODE LIKE ZHSCODE-HSCODE,
             WGBEZ TYPE T023T-WGBEZ,
             SPEC(20) TYPE C,
             MNGLG LIKE STPOX-MNGLG,
             MSEHT LIKE T006A-MSEHT,
             CNTRY(13) TYPE C,
             UPRICE TYPE P LENGTH 16 DECIMALS 2,
             TPRICE TYPE P LENGTH 16 DECIMALS 2,
             CURRCODE TYPE C LENGTH 5,
           END OF TY_IMP_FINAL,
           BEGIN OF TY_MBEW,
             MATNR LIKE MBEW-MATNR,
             VPRSV LIKE MBEW-VPRSV,
             STPRS LIKE MBEW-STPRS,
             VERPR LIKE MBEW-VERPR,
           END OF TY_MBEW.
    DATA: WA_BOM TYPE TY_BOM,
           WA_QUAN TYPE TY_QUAN,
           WA_IMP_FINAL TYPE TY_IMP_FINAL,
           WA_T023T TYPE TY_T023T,
           WA_T006A TYPE TY_T006A,
           WA_MBEW TYPE TY_MBEW.
    DATA: IT_BOM TYPE TABLE OF TY_BOM,
           IT_QUAN TYPE TABLE OF TY_QUAN,
           IT_IMP_FINAL TYPE TABLE OF TY_IMP_FINAL,
           IT_MBEW TYPE TABLE OF TY_MBEW.
      DATA:  IT_STPO TYPE STANDARD TABLE OF STPOX,
             WA_STPO TYPE STPOX.
          SELECT
              MATNR
              VPRSV
              STPRS
              VERPR
               FROM MBEW
                INTO CORRESPONDING FIELDS OF TABLE IT_MBEW.
                    WHERE MATNR EQ IT_MARA-MATNR.    "MBEW
    *I_STPO2 TYPE STANDARD TABLE OF STPOX.
    LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT WHERE CHK = 'X'.
      LOOP AT IT_ZCDR_D INTO WA_ZCDR_D .
          CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

  • Implication of not having EBS structure and clearing accounts

    Hi,
    In-House Cash(IHC) utilizes clearing accounts and Electronic Bank Statements (EBS) structure, however, we are contemplating to introduce an external reconciliation tool which reconciles bank accounts with GL directly and hence omit utilization of EBS and clearing accounts. This will require a non standard SAP configuration for IHC.
    We would like to seek the opinion of the experts here on the potential impact of not using EBS and clearing accounts on IHC and other SAP functionality to help us better assess our options.
    Looking forward to hear your advice. Thank you.
    Regards,
    Alvin Lim

    Are the concentration account and the 4 ZBA accounts all assigned to the same company code?  If so, then yes, you can handle clearing of ZBA postings within EBS.
    The key to the clearings is that the posting type 1 (post) transactions have to post before the posting type 5 (clear) transactions.  EBS posts the statements in the order that they come through in the bank statement file.  So if, for example, the 1st statement in the file contains the incoming ZBA (posting type 5) transaction and the 2nd statement in the file has the outgoing ZBA (posting type 1), the incoming ZBA postings will not clear because at the time the 1st statement is processed, becuase the  outgoing ZBA transaction from the 2nd statement have not posted.
    Where in the file is the concentration account?  Is it before the ZBA accounts?  After the ZBA accounts?  You may need to adjust your configuration based on the order of the accounts in the file.  
    Also, does the concentration account normally have just incoming ZBA transactions, just outgoing ZBA transactions or both incoming and outgoing ZBA transactions?  If the concentration account has both incoming ZBA and outgoing ZBA transactions, then you may need to assign the posting rules differently to the concentration account than to the ZBA accounts.  For example, if the concentration account is the 1st account in the statement, then both 581 and 281 should be assigned to posting rules with posting type 1 (post) - and the ZBA accounts should have 581 and 281 assigned to posting rules with posting type 5 (clear).  If the concentration account is last in the file, then the configuration would be just the opposite - the concentration account would have all posting type 5 posting rules and the ZBA accounts would be posting type 1.
    Also, if you plan to use one clearing GL account, you'll need to make sure to fully specify that account in the account symbol configuration - do not use any masking.
    Regards,
    Shannon

  • Help on error - not mutually convertible in a unicode program

    I am trying to implement a badi - badi_matmas_ale_cr. I want to take contents of sdata to i_marc but getting this error ...any workaround for this. I thought of defining structure of marc with all char fields but that is almost 218 fields so thought if there is anyother way of doing this.
    DATA : wa TYPE LINE OF edidd_tt,
             i_marc type line of MARC_UEB_TT .
      LOOP AT t_idoc_data INTO wa.
        CASE wa-segnam.
          WHEN 'E1MARCM'.
            MOVE wa-sdata TO i_marc.
            IF i_marc-compl+0(1) NE '9'.
              DELETE t_idoc_data INDEX sy-tabix.
            ENDIF.
          ENDLOOP.

    try this
    call method cl_abap_container_utilities=>read_container_c
    exporting
    im_ container = wa-sdata
    importing
    ex_ value = imarc
    exceptions
    illegal_parameter_type = 1
    others = 2.
    Check Re: Table maintenance - change field contents of the already existing entri for reference.

  • Unicode error:a line of internal table and a data object are not mutually c

    Hi Friends,
        This is the issue in upgradation from 4.6c to ECC6.0
        I have an internal table itab which has include structure say 'xyz' . In xyz there is a field of type int4 as third field. I have a field as l_line which is a string.
    data : begin of itab occurs 0.
             include structure zxyz.
    data: end of itab.
    data: l_line type string.
    In the program I am getting the unicode error as:
    " A line of "itab" and "l_line" are not mutually convertible in unicode program." at he following line.
    loop at itab into l_line.
    endloop.
    Thanks,
    Ali.

    Hi Narendran,
    I did the same earlier, but the field l_line is again used in the another line as follows
    IF l_line CS w_group.----
    (1)
    where     w_group         LIKE zstr-cctr_group.
    here zstr-cctr_group is same as one of the fields of structure xyz.
    in line 1 it is giving warning as
    l_line is incompatible and it must be C,N,D,T or string.
    Thanks,
    Ali

  • Mutually convertible Unicode

    When I change the next code (Adaptation unicode):
    IF t004-sakln > 0.
    *{   REPLACE        &$&$&$&$                                          1
    *      DESCRIBE FIELD ska1-bilkt LENGTH sy-fdpos.
          DESCRIBE FIELD ska1-bilkt LENGTH sy-fdpos IN CHARACTER MODE.
    I obtain the next error sintaxis:
    Can you help me, please?
    "SKC1A-GSBER" and "X_FF_GSBER" are not mutually convertible in a Unicode program . . . . .
    IF NOT ( repwaers IS INITIAL ).
        ctyp_waers  = repwaers.
      ELSE.
        ctyp_waers  = skc1a-hwaer.
      ENDIF.
      IF fi_lc_ex = '2'.
    *   Extrakt an FI_LC, Geschäftsbereich austauschen
        SELECT SINGLE * FROM tgsb WHERE gsber = skc1a-gsber.
    *   IF SY-SUBRC = 0 AND TGSB-GSBER_KONS <> SPACE.           "vhs134295
        IF sy-subrc = 0.                                        "vhs134295
          skc1a-gsber = tgsb-gsber_kons.
        ELSE.
          IF NOT skc1a-gsber IS INITIAL.                        "vhs134295
    *       Fehler, Gsber auf HexFF setzen
            skc1a-gsber = x_ff_gsber.
          ENDIF.                                                "vhs134295
        ENDIF.
      ENDIF.
    Cordial greetings.

    Hi,
    under Unicode you can't easely assign values from one variable to another with different datatype.
    skc1a-gsber is char4 and x_ff_gsber seams to be type x?
    Under Unicode there are strict rules. Instead of x = y you can use field-symbols.
    This coding may help you:
    DATA: z_gsber    TYPE skc1a-gsber,
              x_ff_gsber TYPE x.
    FIELD-SYMBOLS: <f_gsber>          TYPE skc1a-gsber,
                   <f_ff_gsber>      TYPE x.
    ASSIGN z_gsber TO <f_gsber>.
    ASSIGN x_ff_gsber TO <f_ff_gsber>.
    <f_gsber> = <f_ff_gsber>.
    The variable z_gsber has now the same value as x_ff_gsber.

  • The type of the database table and work area are not Unicode convertible

    ***Data declaration
    TYPES : BEGIN OF t_zle_lagerplanung,
                       SEl, "stores which row user has selected
                       kdauf TYPE zle_lagerplanung-kdauf,
                       kdpos TYPE zle_lagerplanung-kdpos,
                       etenr TYPE zle_lagerplanung-etenr,
                       papiermaschine TYPE zle_lagerplanung-papiermaschine,
                       runnr TYPE zle_lagerplanung-runnr,
                       prio TYPE zle_lagerplanung-prio,
                       werk TYPE zle_lagerplanung-werk,
                       durchmesser TYPE zle_lagerplanung-durchmesser,
                       breite TYPE zle_lagerplanung-breite,
                       anzle TYPE zle_lagerplanung-anzle,
                       lgpla TYPE zle_lagerplanung-lgpla,
                       lgtyp TYPE zle_lagerplanung-lgtyp,
                       art TYPE zle_lagerplanung-art,
                       anzhoehe TYPE zle_lagerplanung-anzle,
                       fa TYPE zle_lagerplanung-fa,
    END OF t_zle_lagerplanung.
    DATA : it_zle_lagerplanung TYPE STANDARD TABLE OF t_zle_lagerplanung INITIAL SIZE 0,
                wa_zle_lagerplanung TYPE t_zle_lagerplanung.
    Here I am getting the data in internal table by using thiis select statement.
    SELECT kdauf kdpos etenr papiermaschine runnr prio werk durchmesser breite
                  anzle lgpla lgtyp art anzhoehe fa
    FROM    zle_lagerplanung INTO CORRESPONDING FIELDS OF TABLE it_zle_lagerplanung
    WHERE  kdauf IN s_kdauf
    AND       KDPOS IN s_kdpos
    AND      werk = p_werks.
    But while updating the particular field in zle_lagerplanung using this statement
    UPDATE zle_lagerplanung from table it_zle_lagerplanung.
    it is giving syntax error
    "The type of the database table and work area (or internal table)
    "IT_ZLE_LAGERPLANUNG" are not Unicode convertible. "
    Could any one help me out how to resolve this problem....
    Thanks in advance

    Dear Shayamal,
    XXX....are not Unicode convertible
    This  error comes while inserting or updating database and the fields are not matching between  data base table and structure .
    Check you fields of data base table and  "zle_lagerplanung" and struture "it_zle_lagerplanung" . There fields must match.
    thanks and regrds,
    Anup Banerjee

  • Gv_line and  Bvbapkom are not mutually convertable.

    Hi all,
    data: gv_line(6000) type c.
    Bvbapkom = gv_line.
    But i am getting the Error like : gv_line and  Bvbapkom are not mutually convertable.
    Note: Bvbapkom is a Structure
    How do i solve this ?
    Mahesh

    Hi ,
    i got the solution
    ANSWER:
    Field-symbols: <X_Bvbapkom> type x,
                    <X_gv_line>  type x.
    Assign: Bvbapkom to <X_Bvbapkom> casting,
            gv_line  to <X_gv_line>  casting.
    <X_Bvbapkom> = <X_gv_line>.

  • Enhance extract structure and RSA7 (not LIS)

    I have an extractor (not an LIS one) that I have enhanced to have an additional field. This extractor is delta enabled and uses the RSA7 delta queue. I am being told that to implement in production I have to
    1) run a delta load to clear the delta queue
    2) stop all users in R/3 from psoting
    3) transport the change
    It is the step 2) I question - is it really necessary to stop users posting. the argument is that the queue structure will change and may invalidate some delta records. But if I'm just adding a field to the structure I do not think this will mess up the delta's inthe delta queue?
    Anyone know with confidence?

    Hi,
    Yes you have to clear you delta queue; don't forget that you have to run a delta twice since the repeat of a delta needs to be cleared as well.
    At the end you have 0 (LUWs) in RSA7
    You can also check the number of LUWs pending in SMQ1.
    You need to empty your delta queue before transporting your changes.
    Simply because if you have data in the queue and you import your changes not only the structure will change, all related programs as well (internal SAP programs not your extractor itself). When you'll request the next delta, the system may not find your new field for the data or just by checking timestamps and versions of the objects will simple refuse to extract it! And if you can't extract it then you'll have to reinit.
    Since you need to have an empty queue, how could you ensure that it remains empty other than preventing users to post transactions?
    If your point is to NOT disrupt operations and your are able to reload the possible missed transactions, then empty your queue, delete the init, import your changes and then re init your delta; which I think will suits you better.
    In theory you are right, you don't need downtime for postings and we have tested that with no issue for NON LIS sources (the data is stored at posting time); still I don't recommend it.
    In any case, if you are well prepared, the disruption is only 5 or 10 minutes max in the source system during which you stop background processing with BTCTRANS1 (if I remember correctly) and you lock/kick user out (during the night for example).
    We have done that lots of times and are running R/3 with different time zones.... so we always take the opportunity when R/3 guys need a downtime for any parameter changes or DB stuff...
    hope this helps
    Olivier.
    Message was edited by:
            Olivier Cora

  • Rule 168 to work with org structure and not relationships

    Hi,
    I would like to use rule 168 to work with the organizartional structure and not the relationships maintained in PO10 organizational unit.
    this is because i want the agent to be the person with the red hat and not the a002 relationship maintained in organizational unit. i tried using rule 157 but it does the same thing and determines agent based on relationships maintained in org unit.
    basically i dont want the agent to be any of the line mangers which may have been set up, i want it to be the red hat of the org structure
    does anyone know how i can do this, or will i need to delete the relationships between staffing?
    Thanks
    Forhad

    Here is a code example to read from the tables in base to the personnel number emulating the SWE_GET_MANAGER function, I hope this helps. Regards.
    Z GET MANAGER *******************
    ***Gets the position for the creator of the requisition
      clear V_OBJID.
      select single objid into V_OBJID from HRP1001
       where otype  = 'S'        and
              plvar  = '01'       and
              rsign  = 'A'        and
              relat  = '008'      and
              begda  <= sy-datum  and
              endda  >= sy-datum  and
              infty  = '1001'     and
              sclas  = 'US'       and
              sobid  = pt_cont-VALUE+2.
      if sy-subrc = 0.
       valid if the user has personnel number don't proceed to look for the chief
         clear V_OBJID2.
        select single objid into V_OBJID2 from HRP1001
         where otype  = 'S'        and
               objid  = V_OBJID    and
               plvar  = '01'       and
               rsign  = 'A'        and
               relat  = '008'      and
               begda  <= sy-datum  and
               endda  >= sy-datum  and
               infty  = '1001'     and
               sclas  = 'P'.
        if sy-subrc <> 0.
       if the user exist in the correspondant date gets the chief position
          clear V_POS_SOBID_CH.
          select single sobid into V_POS_SOBID_CH from HRP1001
           where otype  = 'S'        and
                 objid  = V_OBJID    and
                 plvar  = '01'       and
                 rsign  = 'A'        and
                 relat  = '002'      and
                 begda  <= sy-datum  and
                 endda  >= sy-datum  and
                 infty  = '1001'     and
                 sclas  = 'S'.
          if sy-subrc = 0.
          if the relationship with a chief position exist gets the chief user id
            clear V_US_SOBID_CH.
            select single sobid into V_US_SOBID_CH from HRP1001
             where otype  = 'S'            and
                   objid  = V_POS_SOBID_CH and
                   plvar  = '01'           and
                   rsign  = 'A'            and
                   relat  = '008'          and
                   begda  <= sy-datum      and
                   endda  >= sy-datum      and
                   infty  = '1001'         and
                   sclas  = 'US'.
            IF sy-subrc = 0.
              clear pt_actor.
              refresh pt_actor.
              pt_actor-otype = 'US'.
              pt_actor-objid = V_US_SOBID_CH.
              append pt_actor.
            endif.
          endif.
        endif.
      endif.
    ***************End of Z GET MANAGER.*****************************

  • Table is not Unicode Convertible

    hello,
    i am getting error the type of tha database table or work area or internal table are not unicode convertible. please help me.
    REPORT ZEXCISE_INVOICE_RTNS
    LINE-COUNT 100
    MESSAGE-ID 8I.
    *INCLUDES
    INCLUDE RVADTABL.
    *TABLES
    TABLES : T001, "Company Codes
    T005, "Countries
    LFA1, "Vendor Master (General Section)
    EKKO, "Purchasing Document Header
    EKPO, "Purchasing Document Item
    MKPF. "Header: Material Document
    *Excise Tables
    TABLES : J_1IEXCHDR, "Excise invoice header detail
    J_1IEXCDTL, "Excise invoice line item details
    J_1IEXCDEF, "Tax default informations
    J_1IMOVEND. "Vendor Master Excise Additional Data
    *INTERNAL TABLES AND STRUCTURES
    DATA : BEGIN OF TJ_1IEXCDTL OCCURS 0.
    INCLUDE STRUCTURE ZJ1IEXCDTL.
    DATA : END OF TJ_1IEXCDTL.
    DATA : i_mseg like mseg occurs 0 with header line.
    DATA : TJ_1IEXCDTL_Temp like TJ_1IEXCDTL occurs 0 with header line.
    DATA : begin of it_ekpo occurs 0,
    ebeln like ekko-ebeln, "PO Number
    ebelp like ekpo-ebelp, "Line item number
    meins like ekpo-meins, "Unit of measurement
    mwskz like ekpo-mwskz, "Tax on Sales/Purchases Code
    netpr like ekpo-netpr, "unit price
    end of it_ekpo.
    DATA : begin of it_a003 occurs 0,
    knumh like a003-knumh, "Condition record number
    kappl like a003-kappl, "Application
    kschl like a003-kschl, "Condition type
    mwskz like a003-mwskz, "Tax on Sales/Purchases Code
    end of it_a003.
    DATA : begin of it_konp occurs 0,
    knumh like konp-knumh, "Condition record number
    kappl like konp-kappl, "Application
    kschl like konp-kschl, "Condition type
    mwsk1 like konp-mwsk1, "Tax on Sales/Purchases Code
    kbetr like konp-kbetr, "Rate/unit
    end of it_konp.
    DATA : begin of it_konv occurs 0,
    knumv like konv-knumv, "Number of the document condition
    kposn like konv-kposn, "Condition item number
    kschl like konv-kschl, "Condition type
    krech like konv-krech, "Calculation type for condition
    kbetr like konv-kbetr, "Rate (condition amount or percentage)
    kwert like konv-kwert, "Condition value
    end of it_konv.
    *VARIABLES
    DATA: RETCODE LIKE SY-SUBRC. "Returncode
    DATA: REPEAT(1) TYPE C.
    DATA: XSCREEN(1) TYPE C. "Output on printer or screen
    DATA: G_FM_NAME TYPE RS38L_FNAM,
    V_SUBTOTAL LIKE J_1IEXCDTL-EXBAS.
    DATA : V_CHID(45) TYPE C,
    V_DESC1(30) TYPE C,
    V_DESC2(30) TYPE C,
    V_DESC3(30) TYPE C.
    DATA : v_document(15) TYPE C.
    SELECTION SCREEN
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_mblnr like mkpf-mblnr OBLIGATORY,
    P_time like SY-UZEIT.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION
    start-of-selection.
    PERFORM GET_DATA.
    CHECK RETCODE = 0.
    Get the form name
    PERFORM GET_FORM_NAME.
    Call the form
    PERFORM CALL_FORM.
    End-Of-Selection
    end-of-selection.
    *FORM GET DATA
    FORM GET_DATA.
    SELECT single * from mkpf where mblnr = P_MBLNR.
    IF sy-subrc <> 0.
    RETCODE = 4.
    message i078(8I).
    exit.
    ELSE.
    PERFORM GET_EXCISE_INVOICE.
    if retcode <> 0.
    MESSAGE i301(8I).
    else.
    PERFORM GET_EXCISE_DETAILS.
    endif.
    ENDIF.
    ENDFORM. "GET_DATA
    *FORM GET EXCISE DETAILS
    FORM GET_EXCISE_DETAILS.
    DATA: KAWRT LIKE KOMV-KAWRT. "Excise Duty - Base Amount
    SELECT * FROM J_1IEXCDTL INTO TABLE TJ_1IEXCDTL
    WHERE TRNTYP = J_1IEXCHDR-TRNTYP
    AND DOCYR = J_1IEXCHDR-DOCYR
    AND DOCNO = J_1IEXCHDR-DOCNO.

    The structures do NOT have to be the same for a CORRESPONDING FIELDS. This works in a test program I have:
    ==================
    DATA: itab TYPE STANDARD TABLE OF istruct.
    SELECT *
    FROM ztab
    INTO CORRESPONDING FIELDS OF TABLE itab
    WHERE vkorg = 'XYZ'
    AND zyear = '2007'
    AND werks = '00A'.
    ===================
    where "istruct" is the same as the DB table definition plus two additional columns and minus MANDT.
    However, in another program I get the "not Unicode compatible" error when I try to activate it.
    Why does it work in one case and not the other? Is it some program setting?

Maybe you are looking for

  • Vendor + Customer Ledger Balance

    Hello Experts, I am end user in Fico We are created some Vendor as a Customer through customer master because we are creating some scrap sales billing to the same vendor means customer. We have seen thier ledger balance as Vendor Bal. in Vendor Ledge

  • Wifi cannot be activated again

    hi, I have been reading through the posts and it seems as though wifi issues are pretty common with the yoga. Once my wifi works, it seems to be performing well. However, I have the issue that the wifi just gets completely lost. when you go into airp

  • Itunes will not open for Mac

    I use a macbook, and after downloaded itunes 9.1, i cannot open itunes unless i plug in my iTouch, when i do not, a window pops up saying," The itunes library cannot be opened because it was created with a newer version of iTunes. I have the most cur

  • W2 boxes mapped to tax form fields or groups

    hi, Is there any documentation that gives the mapping of w2 boxes to the tax form fields or groups? If not anybody made that mapping for the reference? Points guaranteed

  • Timer class become multithread?

    I read book that Timer is thread but single thread and executed sequentially. Now i want to make Timer become multithread and executed simultaneously Code : example : 1. id_action=11, doing task=stm11, Start1 at 9 PM, tmPer11 doing stm11 2. id_action