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.
Similar Messages
-
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 SahaHi,
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 -
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
MAHAHi 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. -
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,
ChristinaHi,
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 -
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. -
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
PankajThis 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' -
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. -
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 -
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 -
Hi all,
I'm copying a report from a older release so I'm getting some Unicode issues.
The report has:
pad25 = i1001_ext-adata.
pad25 - structure
i1001_ext-adata - 600 char field
When I activate I get the message:
"PAD25 and i1001_ext-adata are not mutually convertible in a Unicode program".
Can you help me to adapt this?
Thanks! Reward points for answers.HI,
try doing this...
FIELD-SYMBOLS: <C_STRUC> TYPE C.
assign PAD25 to <C_STRUC> casting.
<C_STRUC> = i1001_ext-adata.
APPEND PAD25.
regards,
priya. -
Mutually incovertible issue in unicode
hi
i am workin on a unicode project.In a certain set of programs i am gettin an error as mutually inconvertible.
<b><u>eg. error</u></b>
"XVBRK" and "ARC_BUFFER-SEGMENT" are not mutually convertible in a Unicode program.
here xvbrk is like vbrk and contains more than 100 fields and i hve 15 errors to deal of same kind.
so anyone can help me with any technique to do this.at what line of code does this error occur. Are "XVBRK" and "ARC_BUFFER-SEGMENT" of the same type.
-
ABAP program issues..Unicode program "ITAB" must have the same structure?
Dear Expert,
I coded below code in se38, but system give below error message, could please kindly advie issue reason? Thanks!!
Error message: A line of "ITAB" and "LINE" are not mutually convertible. In a Unicode program "ITAB" must have the same structure layout as "LINE" independent of the length of a . Unicode character. Unicode character.
REPORT ZTEST_HIHIHI.
Data: begin of line,
num type i,
sqr type i,
end of line,
itab type standard table of line with key table_line.
Do 5 times.
line-num = sy-index.
line-sqr = sy-index ** 2.
append line to itab.
enddo.
loop at itab into line.
write: / line-num, line-sqr.
endloop.
clear itab.Hello Hoo Laa,
This is because the way you have defined LINE, it is a structure & not a data type. Hence you are facing the issue
You have to change the data declaration to:
itab LIKE STANDARD TABLE OF line WITH KEY table_line.
BR,
Suhas -
Error in method READ_CONTAINER_C when passing string to structure in Unicod
Hi All,
We are upgrading system from non-unicode to unicode.
While passing a string to a structure ( MOVE RECEIVERS-RECEIVER TO RECEIVER_OBJECT, where
RECEIVERS_RECEIVER = string
RECEIVER_OBJECT = structure )
following error is thrown :
"RECEIVER_OBJECT" and "RECEIVERS-RECEIVER" are not mutually convertible in a unicode program.
To resolve this error, I've used :
CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C
EXPORTING
IM_VALUE = RECEIVERS-RECEIVER
IMPORTING
EX_CONTAINER = RECEIVER_OBJECT
EXCEPTIONS
ILLEGAL_PARAMETER_TYPE = 1
others = 2
But I observed the problem of inccorect values for numeric fields. For example suppose the string contains the value 'abc1234' and we use CL_ABAP_CONTAINER_UTILITIES=>READ_CONTAINER_C to transfer this string to a structure suppose, S1 with 2 fields namely field1(3) type c and field2 type i. then field1 gets the correct value i.e. 'abc' but field2 gets incorrect value and not '1234'. Can anyone provide the resolution? Prompt reply will be highly appreciated.
Thanks.There is no error in this method. The 'problem' is caused by the fact that you are combining character type and Type I in your parameter which has generic type CSEQEUNCE.
It is advised that you 'copy' your data component by component in Unicode. -
How to assign string to structure in unicode system R/3 4.7 ?
Hi All,
We are upgrading system from non-unicode to unicode.
While passing a string to a structure ( MOVE RECEIVERS-RECEIVER TO RECEIVER_OBJECT, where
RECEIVERS_RECEIVER = string
RECEIVER_OBJECT = structure )
following error is thrown :
"RECEIVER_OBJECT" and "RECEIVERS-RECEIVER" are not mutually convertible in a unicode program.
To resolve this error, i hv used :
CALL METHOD CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C
EXPORTING
IM_VALUE = RECEIVERS-RECEIVER
IMPORTING
EX_CONTAINER = RECEIVER_OBJECT
EXCEPTIONS
ILLEGAL_PARAMETER_TYPE = 1
others = 2
While activating the code, following error message is thrown :
"RECEIVER_OBJECT" is not type-compatible with formal parameter "EX_CONTAINER".
Please help me out to solve this issue ..
I need to know what I am missing here to make my code correct.
Thanks in advance.
PriyaHi All,
My issue is resolved by using following class and method : CL_ABAP_CONTAINER_UTILITIES=> READ_CONTAINER_C and passing 'string' in export parameter and structure in 'import' parameter.
Cheers !!
Priya -
Could you pls give the details about the Unicode conversion during Upgrade
Hi,
Can anyone give details about the Unicode conversion during SAP Upgradation fro 4.6C to ECC6.
Waiting for quick response
Best Regards,
PadhyHi,
These are the few points i gathered during my upgradation project.
Before starting any upgradation project, it is necessary to take up the back-up of the existing systems. As we are going to upgrade the entire system, we will be changing so many things and if something happens, without back-up, we will be in a trouble.
So it is advised to keep a back-up of the existing system.
Say for example we have the existing system E4B which is of Version 4.6C. Now we want to upgrade it to Version 4.7. Let us see how we can do it.
Version upgrades not only means that we need to run the new Version CD over the existing Version System but only involves some other thing.
Version Upgrade involves the following Steps.
Say we want to upgrade for Version 4.7 from Version 4.6, which is in the System E4B. Now we created one more system called as E1B in which the upgradation for Version 4.7 can be done.
First copy the entire E4B system into the E1B System which is created for Version 4.7.
Apply the Version 4.7 CD provided by SAP over the E1B System.
Now check whether all the functionalities that was in E4B system works fine with E1B system also.
Thus the Version Upgrade involves two steps.
1. SAP Upgradation with the help of the CD
2. Manual Upgradation.
1. SAP Upgradation with the help of the CD
This is nothing but after taking the copy of the existing system into a new system, the upgradation CD from SAP is applied over the new system.
2. Manual Upgradation.
This Manual Upgradation involves
2.1 Upgradation of Standard Objects
2.1.1 SPAU Objects
2.1.2 SPDD Objects
2.2 Upgradation of Custom Objects.
Upgradation of Custom Objects can be placed under the following three categories.
Unicode Compliance
Retrofit
Upgrade
Please Find below some of the common Unicode Errors and their solutions
1. Error:
In case of Translate Error; Dangerous use of Translate in Multilingual system.
Correction:
To correct the Error occurring on TRANSLATE statement use this additional statement before the Translate statement.
SET LOCALE LANGUAGE sy-langu.
This statement defines the Text Environment of all the programs & internal sessions in the language specified in the LANGUAGE KEY, which in this case is sy-langu, i.e. the log on language of the user.
2. Error:
In case of Open Dataset Error; Encoding Addition must be included.
Correction:
This Error occurs only when the MODE is TEXT.
To correct the Error occurring on OPEN DATASET statement use this statement instead.
OPEN DATASET dataset_name FOR access IN TEXT MODE ENCODING DEFAULT.
Where: dataset_name NAME OF THE DATASET.
Access INPUT or OUTPUT or APPENDING or UPDATE.
DEFAULT - Corresponds to UTF-8 in UNICODE systems &
NON_UNICODE in NON-UNICODE systems.
3. Error:
In case of the usage of the Obsolete FM UPLOAD/DOWNLOAD or WS_UPLOAD/DOWNLOAD; Function module UPLOAD is flagged as obsolete.
Correction:
The FM GUI_DOWNLOAD/UPLOAD is used.
The variations to be made in the parameters of the FM:
1. Filename It must be of STRING type.
2. Filetype DAT is not used any longer, instead ASC is used.
3. Field Separator The default value SPACE is used, incase for a TAB separated file X can be used.
4. Error:
In case of CURRENCY/UNIT Addition Error; Use addition CURRENCY/UNIT when outputting.
Correction:
The CURRENCY addition specifies the currency-dependant decimal places for the output of the data objects of type i or p. To obtain the currency-key, the field CURRKEY of the table TCURX is used. The system determines the number of the decimal places from the field CURRDEC of the selected CURRKEY.
To correct this error follow the following method:
WRITE: /3 'TOTAL',' ', TOTAL.
WRITE: /3 TOTAL, , TOTAL CURRENCY 2. --- Where 2is the Currency Key for Getting 2 decimal places.
5. Error:
In case of TYPE X Error; Variable must be of C, N, D, T or STRING type.
Correction:
We need to change all the Type X (Hexadecimal) variables to Type C with their values unchanged.
So the method to be followed is:-
1. Load the definition of the class CL_ABAP_CONV_IN_CE or CL_ABAP_CHAR_UTILITIES.
2. Declare the variable as Type C, and use the method UCCP(XXXX) of the class CL_ABAP_CONV_IN_CE where XXXX represents the 8-bit Hexadecimal value and incase the variable holds a Hex value for a Horizontal Tab , then the Attribute HORIZONTAL_TAB of the class CL_ABAP_CHAR_UTILITIES can be used directly instead of using the method UCCP.
E.g.:
i) *DATA: TAB TYPE X VALUE 09, Tab character
CLASS: CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
DATA TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
ii) * DATA: CHAR TYPE X VALUE 160.
CLASS: CL_ABAP_CONV_IN_CE DEFINITION LOAD.
DATA CHAR TYPE C.
CHAR = CL_ABAP_CONV_IN_CE=>UCCP(00AO).
(Here 00A0 is the Hexadecimal equivalent of the decimal 160).
3. Incase the TYPE X Variable has a length more than 1, then an internal table must be created for the variable.
E.g.:
CLASS: CL_ABAP_CONV_IN_CE DEFINITION LOAD.
DATA : LF(2) TYPE X VALUE 'F5CD'.
DATA : BEGIN OF LF,
A1 TYPE C,
A2 TYPE C,
END OF LF.
LF-A1 = CL_ABAP_CONV_IN_CE=>UCCP('00F5').
LF-A2 = CL_ABAP_CONV_IN_CE=>UCCP('00CD').
6. Error:
In case of the Character -Error; The Character -cant appear in names in Unicode Programs.
Correction:
The Character -(Hyphen) appearing in Variable names is replaced by the character _ (Under Score) for Unicode/Upgrade Compliance.
E.g.:
*wk-belnr LIKE bkpf-belnr,
*wk-xblnr LIKE bkpf-xblnr,
*wk-date LIKE sy-datum,
*wk-wrbtr LIKE bseg-wrbtr,
*wk-name1 LIKE lfa1-name1,
*wk-voucher(8) TYPE c.
wk_belnr LIKE bkpf-belnr,
wk_xblnr LIKE bkpf-xblnr,
wk_date LIKE sy-datum,
wk_wrbtr LIKE bseg-wrbtr,
wk_name1 LIKE lfa1-name1,
wk_voucher(8) TYPE c.
7. Error:
In case of The SUBMIT-TO-SAP-SPOOL Error; you should not use the statement SUBMIT-TO-SAP-SPOOL without the WITHOUT SPOOL DYNPRO addition.
Correction:
1. Declare variables of type PRI_PARAMS, ARC_PARAMS, and a variable of TYPE C which would be used as a VALID FLAG.
2. Call the FM GET_PRINT_PARAMETERS:
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_MODE = '3'
DESTINATION = P_DEST
IMMEDIATELY = 'X'
IMPORTING
OUT_ARCHIVE_PARAMETERS = archive_parameters
OUT_PARAMETERS = print_parameters
VALID = valid_flag
EXCEPTIONS
INVALID_PRINT_PARAMS = 2
OTHERS = 4
3. Use the SUBMIT-TO-SAP-SPOOL statement.
E.g.:
submit zrppt500
using selection-set 'AUTO3'
with res_no eq lo_rsnum
with sreserv in preserv
to sap-spool destination p_dest
immediately 'X'. "print immediate
DATA: print_parameters type pri_params,
archive_parameters type arc_params,
valid_flag(1) type c.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
ARCHIVE_MODE = '3'
DESTINATION = P_DEST
IMMEDIATELY = 'X'
IMPORTING
OUT_ARCHIVE_PARAMETERS = archive_parameters
OUT_PARAMETERS = print_parameters
VALID = valid_flag
EXCEPTIONS
INVALID_PRINT_PARAMS = 2
OTHERS = 4
Submit zrppt500
Using selection-set 'AUTO3'
With res_no eq lo_rsnum
with sreserv in preserv
to sap-spool
SPOOL PARAMETERS PRINT_PARAMETERS
ARCHIVE PARAMETERS ARCHIVE_PARAMETERS
WITHOUT SPOOL DYNPRO.
8. Error:
In case of Message Error; Number of WITH fields and number of Place Holders are not same .
Correction:
Split the statement after WITH into the same number as the place holder for that Message ID.
E.g.:
1. * MESSAGE E045.
MESSAGE E045 WITH '' ''.
2. in program ZIPI0801
Start of change for ECC6
message e398(00) with 'Could not find access sequence'
'for condition type:'
p_ptype.
message e398(00) with 'Could not find '
'access sequence'
'for condition type:'
p_ptype.
End of change made for ECC6
9. Error:
In case of Move between 2 different Structures; The structures are not mutually convertible in a Unicode program.
Correction:
Make both the Data Types compatible and then assign the contents.
E.g.:
The statement move retainage_text to temp_text. Gives an error, where RETAINAGE_TEXT is an internal table and TEMP_TEXT is a string of length 200.
A Feasible solution for this is to specify from which position to which position of the string, the fields of RETAINAGE_TEXT should be assigned.
TEMP_TEXT+0(1) = RETAINAGE_TEXT-DQ1.
TEMP_TEXT+1(1) = RETAINAGE_TEXT-HEX.
TEMP_TEXT+2(20) = RETAINAGE_TEXT-FILLER1.
TEMP_TEXT+22(15) = RETAINAGE_TEXT-AMT_DUE.
TEMP_TEXT+37(8) = RETAINAGE_TEXT-TEXT.
TEMP_TEXT+45(10) = RETAINAGE_TEXT-DUE_DATE.
TEMP_TEXT+55(1) = RETAINAGE_TEXT-DQ2.
10. Error:
In case of no description found; add a GUI title.
Correction:
In this type of error gui title is generally missing so add a GUI title to the module pool.
11. Error:
In case of writing internal or transparent table
Correction:
Write individual fields.
E.g.:
WRITE: / EXT. --> EXT should be a character type field
WRITE: / EXT-ZZSTATE, EXT-LINE_NO, EXT-LINE_TXT, EXT-AMT, EXT-ZZSKUQTY.
12. Error:
In case of combination reference table/field S541-UMMENGE does not exist
Correction:
Was due to error in reference table S541. TABLE S541 has errors
1)Foreign key S541- ZZMARKET (ZZMARKET AND KATR2 point to different domains)
2)Foreign key S541-ZZACQUIGRP (ZZACQUIGRP AND KATR8 point to different domains)
Changed the domain of ZZMARKET (from ZMKCODE to ATTR2)
And that of ZMKCODE (from ZACCODE to ATTR8)
13. Error:
In case of KEY does not exist
Correction:
The reference table for field KBETR was KNOV earlier changed it to RV61A as KNOV was in turn referring to RV61A.
14. Error:
Incase of WRITE statement, Literals that take more than one line is not permitted in Unicode systems.
Correction: To correct this error, we need to align the spaces accordingly so that the statement doesnt go beyond the line.
15. Error:
Incase of Data statement, The data type ZWFHTML can be enhanced in any way. After a structure enhancement, this assignment or parameter might be syntactically incorrect ..
Correction: To correct this error, instead of like in the Data statement, use type.
16. Error:
Incase of DESCRIBE statement, DESCRIBE can be used only with IN BYTE... Or IN CHARACTER mode in Unicode systems.
Correction: To correct this error, use additional text, IN BYTE MODE / IN CHARACTER MODE along with this statement.
CHARACTER MODE is added when the data object is of flat/ character type.
BYTE MODE is added when the data object is a deep structure.
Syntax: DESCRIBE FIELD data_obj : LENGTH blen IN BYTE MODE,
LENGTH clen IN CHARACTER MODE.
Where blen and clen must be of type I.
17. Error:
Incase of DO-LOOP Error, In Do loop range addition needed
Correction:
An internal tables is declared and the two fields (VARYING field and NEXT field) were
Included inside the internal table
E.g.: In program SAPMZP02
DO 11 TIMES
VARYING STATION_STATE FROM STATION1 NEXT STATION2. ECC6
CASE SYST-INDEX.
WHEN 1
STATION_STATE = STATION1.
WHEN 2
STATION_STATE = STATION2.
WHEN 3
STATION_STATE = STATION3.
WHEN 4
STATION_STATE = STATION4.
WHEN 5
STATION_STATE = STATION5.
WHEN 6
STATION_STATE = STATION6.
WHEN 7
STATION_STATE = STATION7.
WHEN 8
STATION_STATE = STATION8.
WHEN 9
STATION_STATE = STATION9.
WHEN 10
STATION_STATE = STATION10.
WHEN 11
STATION_STATE = STATION11.
18. Error:
Incase of the parameter QUEUE-ID Error, QUEUE-ID is neither a parameter nor a select option in program rsbdcbtc.
Correction:
The parameter in program rsbdcbtc is QUEUE_ID and so is changed in this program
E.g.: In program Z_CARRIER_EDI_INTERFACE
submit rsbdcbtc with queue-id = apqi-qid and return. "ECC6
The parameter name changed by replacing '-' with '_' as in program rsbdcbtc "ECC6
Submit rsbdcbtc with queue_id = apqi-qid and return. "ECC6
19. Error:
Incase of EPC Error, Field symbol <TOT_FLD> is not assigned to a field .
Correction:
This error couldn't be rectified as the error occurs in a Standard SAP include- LSVIMF29.
The OS Note - 1036943 needs to be applied.
Error:
OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE.
Correct:
OPEN DATASET P_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
Error:
Constants : c_tab type x value '09' .
Correct:
Constants : c_tab type abap_char1 value cl_abap_char_utilities=>horizontal_tab .
Error:
Data : begin of output_options occurs 0 . Include structure ssfcompop.
Data : end of output_options .
Correct:
Data : output_options type standard table of ssfcompop with header line .
Error:
PARAMETERS : NAST TYPE NAST .
Correct:
PARAMETERS : NAST TYPE NAST NO-DISPLAY .
Replace WS_DOWNLOAD and WS_UPLOAD by
GUI_UPLOAD and GUI_DOWNLOAD and check the import and export parameter types , do the changes accordingly. Because FILENAME paramater type is different because of this it will give dump.
For issue during Issue using SO_NEW_DOCUMENT_ATT_SEND_API1 Function module, the solution is After this FM we should put COMMIT WORK.
Issue:
Moving data from one structure to another structure if those two structures are not compatible
Solution:
we should use move-corresponding or field by filed we need to move it.
If database structures are different in 4.6c and ECC6.0,
Then we should go with append structure concept.
While testing the report if it gives dump at Select query level or any database or view level,then just goto that table or view and goto the data base utility(se14) adjust the database. But make sure that selected radio button in se14 transaction should be activate and adjust database
Also Check this link.
http://help.sap.com/saphelp_nw04/helpdata/en/62/3f2cadb35311d5993800508b6b8b11/frameset.htm
Reward points if helpful.
Regards,
Ramya
Maybe you are looking for
-
Customer Service Miscommunication and a large lack of communication and follow through
I seem to be having a lot of difficulty with Verizon Wireless Customer Service the last few months and am becoming increasingly frustrated. Let me start by saying I have been with Verizon for years, my wife, kids, and in laws all have Verizon, and my
-
Product Costing with Moving Average Price
Dear Experts, Please guide me solution of my below scenario : - FG Material (500013) Process Order Created of 1000 units at 1st August. - FG Material (500013) Process Order confirmed and GR posted at 3rd of August. - All stock of FG Material (500013
-
After a browsing session using Firefox, my system behaves like either the Contol key or Alt key is stuck "on". For example if I start clicking icons on my desktop, each one is highlighted and "added" as if I were holding down the control key while cl
-
How to use bind variables using in clause in SQL
Hi Can any one help me in regards Bind variables usage using in clause in sql for String data? thans
-
I have been very satisfied with Mozilla Firefox until recently. I have Firefox 3.6.3. Every time a box appears with "installing updates" it installs updates then the screen goes to "problem loading page" and "the proxy server is refusing connections"