2014 Oct 24 2:48 AM
Below is the program code:
REPORT ZASSIGN1.
TABLES: KNA1.
*------SELECT-OPTION-----*
.
SELECT-OPTIONS: CUSTCODE FOR KNA1-KUNNR NO INTERVALS.
WRITE:/ 'Customer List'.
WRITE:/ 'Customer Code :', CUSTCODE.
WRITE:/ '------------------------------------------------------------------------------'.
WRITE:/1 'Customer Code',20 'Customer Name',70 'Address'.
WRITE:/ '------------------------------------------------------------------------------'.
SELECT * FROM KNA1 WHERE KUNNR IN CUSTCODE.
WRITE:/1 KNA1-KUNNR,
20 KNA1-NAME1,
70 KNA1-ADRNR.
ENDSELECT.
----------------------------------------------------------------------------------------------
but, when i input CUSTCODE: TMF*
there is an error output as below:
Why there is an ICP code infront of the output?
Thanks, regards.
liyana.
2014 Oct 24 3:52 AM
Hi,
You defined CUSTCODE as a select options, so ICP is:
CUSTCODE-sign = I "including
CUSTCODE-option = CP "Contains pattern.
It's automatically populated this way when you entered * in CUSTCODE.
Read the online help for select-options for more info.
Regards,
Custodio
2014 Oct 24 3:57 AM
Hi,
Just to complement your answer:
When you use WRITE: CUSTCODE, actually you are printing the header of internal table that selection-options created.
Debug your code and check the content of CUSTCODE.
Take care!
Furlan
2014 Oct 24 4:16 AM
2014 Oct 24 4:21 AM
For that you can do below:
"IF IT HAS ONE LINE THEN:
READ CUSTCODE INDEX 1.
IF SY-SUBRC IS INITIAL.
WRITE:/ 'Customer Code :', CUSTCODE-LOW.
ENDIF.
"If multiple lines
Loop at CUSTCODE.
WRITE:/ 'Customer Code :', CUSTCODE-LOW.
ENDLOOP..
Thanks,
Naveen
2014 Oct 24 4:36 AM