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

ALV Issue with Header

Former Member
0 Likes
1,516

Hi ,

I have copied a standard program RPCIPS00 to a z program. The only change which I have done is added some of the custom fields from the standard table which were not being selected.Now when I execute the report I am able to see the output but not able to see the header and the output gives this message .

"Due to the sort criteria, no header information can be displayed".

Any inputs why this problem could be arising ?

Regards,

Ankur Bhandari

14 REPLIES 14
Read only

Former Member
0 Likes
1,489

Hi Ankur,

Yesterday i tried that, i got the same message...

i observed one thing that we are not passing any sort info to the alv FM, so try to pass the sort table info to the FM, since the first one is std and it is getting from some standard program,,,

Try that..

Thanks

vijay

Read only

0 Likes
1,489

But isn't it_sort being imported from the function module.So how can we pass the sort table ?

Ankur

Read only

0 Likes
1,489

May be you need to build sort table and pass it to the FM. then you might be able to see the sort info from

in the top of list from info fm.

thanks

vijay

Read only

0 Likes
1,489

Hi Vijay,

Have you tried this already ? I want to be sure before modifying the code.

Ankur

Read only

0 Likes
1,489

Hi ankur,

that is what i feel, but if you want to try that just create the temp program and check. don't disturb your code. sort info is not there in your code, just pass it.

and check..

thanks

vijay

Read only

0 Likes
1,489

I copied the standard program to a z program. Didnt do any modifications. I am still getting the same message. Any inputs now ?

Ankur Bhandari

Read only

0 Likes
1,489

Hi Ankur,

I tried the same at my end.

1. I got the problem.

2. The problem is that

there is default VARIANT 1_STD (For ALV Layout)

which is hardcoded.

3. So our Z program does not get

any default variant

and hence, there is no sort criteria.

and hence the message which

is justified as per ALV

4. Do This in ur z program

(it will solve the problem)

5. In the form

FORM top_of_list.

6. Insert the Patch (as mentioned between the lines)

CALL FUNCTION 'REUSE_ALV_LIST_LAYOUT_INFO_GET'

IMPORTING

et_sort = it_sort[]

EXCEPTIONS

no_infos = 1

program_error = 2

OTHERS = 3.

*----


PATCH START

REFRESH it_sort.

CLEAR it_sort.

it_sort-spos = '01'.

it_sort-fieldname = 'DOCNUM'.

it_sort-tabname = 'I_OUTTAB'.

it_sort-up = 'X'.

it_sort-group = '*'.

it_sort-subtot = 'X'.

it_sort-comp = 'X'.

APPEND it_sort.

CLEAR IT_SORT.

it_sort-spos = '02'.

it_sort-fieldname = 'DOCLIN'.

it_sort-tabname = 'I_OUTTAB'.

it_sort-up = 'X'.

APPEND it_sort.

*----


PATCH END

IF sy-subrc NE 0.

MESSAGE s257.

EXIT.

ENDIF.

7. Now Run, It works FANTASTIC.

8. There are other ways to solve this problem,

but for time being do this.

Regards,

Amit M.

Message was edited by: Amit Mittal

Read only

0 Likes
1,489

Hi ANkur,

i'm also copied and didn't do any modifications, once you copied you are no where in standard environment. because of that it is not giving the sort info.

do one more thing, in the original sap program keep the break point in top_of_list and see in debug mode how it is fetching the sort data, though they didn't pass the data to lav display..., what i am thinking our program in not in std environment so we need to supply the info to the FM so that we will get the data back.

pleae check the above threads...

and send the sort info to ALV FM.

thanks

vijay

Message was edited by: Vijay Babu Dudla

Read only

0 Likes
1,489

Hi Amit,

Your answer was very helpful but I will wait for your point .

"8. There are other ways to solve this problem,

but for time being do this."

As in this case we are just modifying the it_sort and calling that function module is not needed.

Regards,

Ankur Bhandari

p.s Also when I save the layout once the report is executed , the option/checkbox for "user specific" layout is always checked and is greyed out. Any pointers why it is so and how can we edit this value.

Message was edited by: Ankur Bhandari

Read only

0 Likes
1,489

Hi Ankur,

else you can copy the variant which std program is using.

i have a doubt, you want sort info to be printed in top of list or not.

if you want then you need to pass the sort table to alv FM.

thanks

vijay

Read only

0 Likes
1,489

Amit did you get a chance to clarify on other options.

Regards,

Ankur Bhandari

Read only

0 Likes
1,489

Hi Ankur,

1. There are other possibilities,

out of which some i don't know how to achieve

( im still searching for it)

and some are which manual intervention is required.

I will brief it.

Some technicaliteis are involved

and they are the truth of it.

2. In this program report,

IT_SORT is a MUST

bcos based on this it shows some busines information

on the top of alv

I think u AGREE on this.

SAP created 3 ALV Layout Variants

and HARDCODED 1 of them as Default.

Hence, IT_SORT is populated and

output is perfectly OK

Till, this U AGREE. (i suppose)

3. So our program should also have

IT_SORT by SOME OR OTHER Method.

4. We have the following options :

a) Create a new alv variant and hardcode

in our Z Program

-- possible --

b) If possible, COPY the original programs

ALV Variant into our Z program

and no problem at all.

-


i don't know how to copy, still seraching---

c) Hardcode IT_SORT as we did

-


this info was taken while debuggin original progam IT_SORT ---

5. Problems in a,b,c

a) Such variant needs to be Manually created

in each server/client (DEV, QA, PRD)

b) Copying has to be done manuually for

each server.

If it can be included in transport request,

then no problem at all like (a)

c) Hardcoding comes

But i still feel, if (a) and (b)

are not working, C is the best.

6. I delayed my answer because

i was still searching for the BEST WAY Out !

7. I suppose im able to satisfy my point no 8

and also make clear the problems involved

in achieving the best way out!

regards,

amit m.

Message was edited by: Amit Mittal

Read only

0 Likes
1,489

Hi again,

1. which option did u go for / or are planning

to go for a, b c or something other ?

regards,

amit m.

Read only

Former Member
0 Likes
1,489

Hi,

There could be a possibility that you are Sorting the table after which you are using AT NEW. In this case only the primary key fields would retain value in internal table. So if you are using AT NEW, then before using AT NEW, copy all the values from one work area(1) to another work area(2) of same type.

Then use work area(2) for the data which you are passing to the ALV.

Hope this solves the problem.

Best regards,

Prashant