‎2019 Dec 30 5:52 AM
req.jpgHi Guys,
I am new to reports, i received a task to genereted an simple ALV reports for "materical master" .As per got the output.
But i have an issue regarding Top-of-page. Ie., "When i give an input of materical number in selection screen that need to display in Top-of-page" as Header. I have google in SCN and create an source but NOT getting correct result..
Can someone, provide an sample coding please..
"I HAVE ATTACHED AN SCREENSHOT FOR REFERENCE"....
‎2019 Dec 30 7:23 AM
Debug your program and you'll see that your input "23" is stored in the variable with leading zeroes. What is displayed is called "external" format, and what is stored in variables and database is called "internal" format. Some ABAP code defined as a conversion routine/exit is executed automatically to convert from internal to external format and vice versa.
WRITE ... TO ... implicitly calls the conversion routine (from internal to external format), but you need to write field by field, not the whole structure as you currently do. For instance, you may try this in debug to see the results:
TABLES mara.
SELECT-OPTIONS s_matnr FOR mara-matnr.
DATA output TYPE c LENGTH 100.
WRITE s_matnr-low TO output. " removes leading zeroes
WRITE s_matnr TO output. " does not remove leading zeroesNB: please don't post code as image, because people will have to type the code by themselves.
‎2019 Dec 30 6:58 AM
Hi,
You output is correct with respect to your code. What you need to do is write sv_matnr-low and sv_matnr-high seperately while removing leading zeroes.
ps: It's material and not materical...
‎2019 Dec 30 7:23 AM
Debug your program and you'll see that your input "23" is stored in the variable with leading zeroes. What is displayed is called "external" format, and what is stored in variables and database is called "internal" format. Some ABAP code defined as a conversion routine/exit is executed automatically to convert from internal to external format and vice versa.
WRITE ... TO ... implicitly calls the conversion routine (from internal to external format), but you need to write field by field, not the whole structure as you currently do. For instance, you may try this in debug to see the results:
TABLES mara.
SELECT-OPTIONS s_matnr FOR mara-matnr.
DATA output TYPE c LENGTH 100.
WRITE s_matnr-low TO output. " removes leading zeroes
WRITE s_matnr TO output. " does not remove leading zeroesNB: please don't post code as image, because people will have to type the code by themselves.