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 GRID

Former Member
0 Likes
1,006

Dear colleagues,

have some questions regarding the ALV Grid functionality.

Situation:

I am  using an ALV-Grid for reporting. It is an multi-level process means, using 2  Dynpro with different data base structures.

First dynpro contains information that should by downloaded to excelsheet including header information from selection-screen on top of grid,

second dynpro contains detailed information and if a row is marked transaction FB03 is called.

1. Include Header informations in ALV container.

   Starting export ALV-Grid informations to excel  and selection-screen parameters should be imported on top of page  in excel sheet.

   Actual I'm working with method 'SET_TABLE_FOR_FIRST_DISPALY'  and everything fits fine, only the header information is missing and should be

   included in excel.

   In SAP documentations und help portals I read, if  using fuba 'REUSE_ALV_GRID_DISPLAY' the header information is exported to excel but you

   have  to use  fullscreen mode . Question: somebody know something about a method solving my prolem or any other idea to manage.

2. Set variants in multi-level  ALV-grid

    user saves a Grid variant on  second level ALV and if he's starting report by using saved ALV variant, informations on first level ALV contains less 

    rows  than expected. If variant on first level it's the same secondary effect.

    Any idea to solve problem?

   

3. After 'CAll TRANSACTION' problems when F3 Button(Back) some returning problems

   Starting from 2 Dynpro, marking a row and calling transaction to FB03 everything  fine but  pressing F3-Button(BACK return-routine) sometimes 

   have  to press more than once until returning to calling ALV.

Thanks you for your ideas and support

Michael

Dear colleagues,

have some questions regarding the ALV Grid functionality.

Situation:

I am  using an ALV-Grid for reporting. It is an multi-level process means, using 2  Dynpro with different data base structures.

First dynpro contains information that should by downloaded to excelsheet including header information from selection-screen on top of grid,

second dynpro contains detailed information and if a row is marked transaction FB03 is called.

1. Include Header informations in ALV container.

   Starting export ALV-Grid informations to excel  and selection-screen parameters should be imported on top of page  in excel sheet.

   Actual I'm working with method 'SET_TABLE_FOR_FIRST_DISPALY'  and everything fits fine, only the header information is missing and should be

   included in excel.

   In SAP documentations und help portals I read, if  using fuba 'REUSE_ALV_GRID_DISPLAY' the header information is exported to excel but you

   have  to use  fullscreen mode . Question: somebody know something about a method solving my prolem or any other idea to manage.

2. Set variants in multi-level  ALV-grid

    user saves a Grid variant on  second level ALV and if he's starting report by using saved ALV variant, informations on first level ALV contains less 

    rows  than expected. If variant on first level it's the same secondary effect.

    Any idea to solve problem?

   

3. After 'CAll TRANSACTION' problems when F3 Button(Back) some returning problems

   Starting from 2 Dynpro, marking a row and calling transaction to FB03 everything  fine but  pressing F3-Button(BACK return-routine) sometimes 

   have  to press more than once until returning to calling ALV.

Thanks you for your ideas and support

Michael

6 REPLIES 6
Read only

Former Member
0 Likes
939

For the first issue, if you want the heading for the columns in excel sheet, pass them in your output table as the first row.

Second issue, refer this link regarding screen variants.

http://scn.sap.com/docs/DOC-27331

Third issue - Try submit program name and return.


Read only

0 Likes
939

Hi Susan,

thanks for your answers.

1st Issue: Could you please be more precise how to include/add an additional line into the downloaded excel data. From my understanding only the information of the table content is downloaded.

2nd Issue:

I'm working with 2 ALV Grids (Main and Details Information) and only on the first ALV Grid you can save ALV variants. However when I start the ALV with the previously saved variant, it happens that on the second ALV (Details Information) not all the possible columns are shown but they can be selected from the field catalog. Note: when I call the 2nd ALV Grid I don't pass any information for the fieldcatalog which prevents columns from being displayed nor do I pass any variant information. - So I would expect all columns to be displayed.

3rd Issue:

Not tried yet. But I will do so

Thanks,

Michael

Read only

0 Likes
939

When I did this, my internal table contained fields of character datatype with length greater than or equal to the original datatype of each field.

And before filling that internal table with data, I called the first inserted a row with each field containing the name of the field.

Eg

begin of it_out.

  bukrs(4) type c,

belnr(10) type c,

gjahr(4) type c,

end of it_out.

* Fill header.

wa_out-bukrs = ''Code'.

  wa_out-belnr = 'Doc No'.

wa_out-gjahr = 'Ýear'.

append wa_out into it_out .

* Fill data

loop at i_data into wa_data.

wa_out-bukrs = wa-data-bukrs

wa_out-belnr = wa_data-belnr

wa_out-gjahr = wa_data-gjahr

append wa_out into it_out .

endloop

Now when we export this table it_out to excel, the first row would be heading row for each field.

Read only

Former Member
0 Likes
939

This message was moderated.

Read only

Former Member
0 Likes
939

Hi Guys,

I solved issue 2:

The problem was because of function module 'LVC_FIELDCATALOG_MERGE' has two importing parameters:

I_STRUCTURE_NAME and I_INTERNAL_TABNAME and I filled only I_STRUCTURE_NAME.

With the parameter I_STRUCTURE_NAME you get all the fields according to the DDic settings filled and if I_INTERNAL_TABNAME is initial, then the system sets 1 as default value in column tabname of the fieldcatalog.

The second time (for the details display) I was calling this function module the same think happened. So the ALV Grid was not able to properly distinguish between the field catalog for the overview data and the details data.

After I pass the correct tab/structure name to parameter I_INTERNAL_TABNAME everything works fine.

3rd issue:

Since when can you start a transaction with the command SUBMIT? I thought this is for reports only.

Kind regards,

Michael

Read only

0 Likes
939

Every transaction has program name associated with it. And you have an option of calling the transaction using the transaction code, or submit program using the program behind the transaction and the corresponding selection screen no.

But anyway, for this third issue, I think I know the problem.

You need to call the ALV with these conditions. It will work fine. Use the respective variables used in your program.

  if CONT1 is initial.

    create object cont1 exporting container_name = 'CONT1'.

    create object grid1 exporting i_parent       = CONT1.

    call method grid1->set_table_for_first_display

      exporting

        i_structure_name = 'itab'

        is_layout        = s_layo

      changing

        it_outtab        = itab

        it_fieldcatalog  = it_fieldcat.

  else.

    call method grid1->refresh_table_display.

  endif.