‎2012 Oct 01 10:20 PM
I am attempting to use the FM POPUP_WITH_TABLE but am running into the following short dump whenever I attempt to run my program.
Short Text:
Data Objects in Unicode programs cannot be converted.
Error Analysis:
The statement "MOVE src to dst" requires that the operands "dst" and "src" are convertible. Since this statement is in a Unicode program, the special conversion rules for Unicode programs apply. In this case, these rules were violated.
My Code:
FORM userexit_move_field_to_vbap.
***********************************************************************
*Condition where dialog box will only appear when the material
*number is populated/changed but will not display if any other field
*in the line is modified.
DATA ls_xvbap TYPE vbap.
LOOP AT xvbap INTO ls_xvbap WHERE posnr = vbap-posnr AND
vbeln = vbap-vbeln.
ENDLOOP.
IF ls_xvbap-matnr <> rv45a-mabnr.
*Type used for outputting to ALV
types: begin of ty_output,
matnr type matnr,
menge type bstmg,
eindt type eindt,
lbkum type lbkum,
end of ty_output.
data lt_output type table of ty_output.
SELECT ekpo~matnr
ekpo~menge
eket~eindt
mbew~lbkum
FROM ekpo
JOIN eket ON ( ekpo~ebeln = eket~ebeln AND ekpo~ebelp = eket~ebelp )
JOIN mbew ON ( ekpo~matnr = mbew~matnr )
INTO CORRESPONDING FIELDS OF TABLE lt_output
WHERE ekpo~matnr = rv45a-mabnr. "and eket~eindt > sy-datum.
SORT lt_output ASCENDING BY eindt.
DATA ls_output TYPE ty_output.
LOOP AT lt_output INTO ls_output.
IF sy-tabix > 1.
DELETE lt_output.
ENDIF.
ENDLOOP.
**Creation of output table
CALL FUNCTION 'POPUP_WITH_TABLE'
EXPORTING
endpos_col = 100
endpos_row = 2
startpos_col = 1
startpos_row = 1
titletext = 'Line Item Added'
* IMPORTING
* CHOICE =
TABLES
valuetab = lt_output
* EXCEPTIONS
* BREAK_OFF = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
ENDIF.
ENDFORM. "USEREXIT_MOVE_FIELD_TO_VBAP
Thanks for your help!
‎2012 Oct 01 10:32 PM
check in FM POPUP_WITH_TABLE if lt_output is defined correctly. ur program definition should match that in FM.
‎2012 Oct 02 10:12 AM
The internal table must be unicode compatible with the internal table of the FM, it must only contain character type subfield (In fact it must be a text string)
You could use a FM like REUSE_ALV_GRID_DISPLAY_LVC (with i_screeen_start/end_column/line parameters provided) or REUSE_ALV_POPUP_TO_SELECT.
Regards,
Raymond