Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SELECT PROBLEM

Hi Gurus,

Can anyone help me with this code. The system give me this message

"Unable to interpret "A~PRODNUM". Possible causes of error: Incorrect spelling or comma error."

Hope someone can help with this.

thanks very much.

gerald

REPORT ZSAMP_ALV no standard page heading.

type-pools: slis.

tables: zstore_prod, zprod_stan.

types: begin of itab,

prodnum like zstore_prod-prodnum,

prodname like zstore_prod-prodname,

prodmanuf like zstore_prod-prodmanuf,

class like zstore_prod-class,

mandat like zprod_stan-mandat,

typpak like zprod_stan-typpak,

LINE_COLOR(4) TYPE C,

end of itab.

data: t_tab type standard table of itab initial size 0,

wa_tab type itab.

data: GD_LAYOUT TYPE SLIS_LAYOUT_ALV,

GD_REPID TYPE SY-REPID,

fieldcat type slis_fieldcat_alv,

t_fieldcat type slis_t_fieldcat_alv.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

select-options: prodnum for zstore_prod-prodnum.

SELECTION-SCREEN END OF BLOCK B1.

START-OF-SELECTION.

PERFORM DATA_RETRIEVAL.

PERFORM BLD_FLDCAT.

PERFORM BDL_LAYOUT.

PERFORM DISPLAY_ALV_REPORT.

FORM BLD_FLDCAT.

fieldcat-tabname = 'ITAB'.

fieldcat-fieldname = 'PRODNUM'.

fieldcat-seltext_l = 'Product Number'.

fieldcat-col_pos = 1.

append fieldcat to t_fieldcat.

fieldcat-tabname = 'ITAB'.

fieldcat-fieldname = 'PRODNAME'.

fieldcat-seltext_l = 'Product Name'.

fieldcat-col_pos = 2.

append fieldcat to t_fieldcat.

fieldcat-tabname = 'ITAB'.

fieldcat-fieldname = 'PRODMANUF'.

fieldcat-seltext_l = 'Product Manufacturer'.

fieldcat-col_pos = 3.

append fieldcat to t_fieldcat.

fieldcat-tabname = 'ITAB'.

fieldcat-fieldname = 'CLASS'.

fieldcat-seltext_l = 'Product Class'.

fieldcat-col_pos = 4.

append fieldcat to t_fieldcat.

fieldcat-tabname = 'ITAB'.

fieldcat-fieldname = 'MANDAT'.

fieldcat-seltext_l = 'Product Manufacturing Date'.

fieldcat-col_pos = 5.

append fieldcat to t_fieldcat.

fieldcat-tabname = 'ITAB'.

fieldcat-fieldname = 'TYPPAK'.

fieldcat-seltext_l = 'Product Type of Packaging'.

fieldcat-col_pos = 6.

append fieldcat to t_fieldcat.

ENDFORM.

FORM BDL_LAYOUT.

GD_LAYOUT-NO_INPUT = 'X'.

GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.

GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.

GD_LAYOUT-CONFIRMATION_PROMPT = 'X'.

ENDFORM.

FORM DATA_RETRIEVAL.

data: LD_COLOR(1) type c,

select aprodnum aprodname aprodmanuf aclass bmandat btyppak

from zstore_prod as a left outer join zprod_stan as b on

aprodnum = bprodnum into table t_tab

where a~prodnum in prodnum.

LOOP AT t_tab INTO wa_tab.

LD_COLOR = LD_COLOR + 1.

IF LD_COLOR = 3.

LD_COLOR = 1.

ENDIF.

CONCATENATE 'C' LD_COLOR '10' INTO wa_tab-LINE_COLOR.

MODIFY t_tab FROM wa_tab.

ENDLOOP.

ENDFORM.

FORM DISPLAY_ALV_REPORT.

GD_REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = GD_REPID

  • I_CALLBACK_TOP_OF_PAGE = slis_ev_top_of_page

IS_LAYOUT = GD_LAYOUT

IT_FIELDCAT = t_fieldcat

TABLES

T_OUTTAB = t_tab.

ENDFORM.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question