Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

USING HEADER

divsmart
Participant
0 Likes
914

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"....

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
738

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 zeroes

NB: please don't post code as image, because people will have to type the code by themselves.

2 REPLIES 2
Read only

dev_parbutteea
Active Contributor
738

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...

Read only

Sandra_Rossi
Active Contributor
739

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 zeroes

NB: please don't post code as image, because people will have to type the code by themselves.