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

Former Member
0 Likes
754

Hi,

I have one clarification regarding ALV.

I am getting ID from one table but description is getting from one BAPI function module for that ID.

Description is not storing in any database table.it is storing in variable.

In this how can I display the fileds on output screen using the function module 'REUSE_ALV_GRID_DISPLAY'.Because I need to fill the Field catalog right?.How can I go about this?

Many Thanks,

Regards,

Anu.

Hi,

I have one clarification regarding ALV.

I am getting ID from one table but description is getting from one BAPI function module for that ID.

Description is not storing in any database table.it is storing in variable.

In this how can I display the fileds on output screen using the function module 'REUSE_ALV_GRID_DISPLAY'.Because I need to fill the Field catalog right?.How can I go about this?

Many Thanks,

Regards,

Anu.

7 REPLIES 7
Read only

Former Member
0 Likes
724

Hi Anu,

Build the output table that contains both the ID and description text.

Suppose if you have ID in an internal table itab. Then build the output table:

LOOP AT itab.

outtab-id = itab-id.

//Call the BAPI ID field

CALL FUNCTION 'BAPI__*'

IMPORTING

ID = itab-id

EXPORTING

DESC = outtab-desc.

APPEND outtab.

ENDLOOP.

Now use the table OUTTAB for display in ALV.

Regards,

Wenceslaus.

Read only

Former Member
0 Likes
724

Hi Anu,

is ID and the description of that id are the two fields in the internal table.

first you get the id description from the FUNCTION MODULE and then pass that variable in to final internal table field and then append that final interanal table.

then pass that final internal table into 'REUSE_ALV_GRID_DISPLAY' function module i think this will work

Thanks

Vikranth Khimavath

Read only

former_member480923
Active Contributor
0 Likes
724

Hi

please follow the following

a) create a single internal table where you will store teh ID and the ID description.

b) When you are building the field catalog please follwo the manual method and then fill in the filedcatalog.

hope this will help

Anirban

Read only

0 Likes
724

Hi,

How we will fill the Field catalog with manual method?Can you please give me one example?

Thanks & Regards,

Anu.

Read only

0 Likes
724

data: ls_fieldcat type sls_alv_fieldcat,

lt_fieldcat type table of ls_fieldcat.

data: begin of itab occurs 0,

matnr like matnr,

maktx like maktx,

mtart like mtart,

end of itab.

**********building fieldcat*********

ls_fieldcat-fieldname = 'matnr'.

ls_fieldcat-sel_text = 'material'.

append ls-fieldcat to lt_fieldcat.

ls_fieldcat-fieldname = 'maktx'.

ls_fieldcat-sel_text = 'description'.

append ls-fieldcat to lt_fieldcat.

ls_fieldcat-fieldname = 'mtart'.

ls_fieldcat-sel_text = 'type'.

append ls-fieldcat to lt_fieldcat.

Read only

0 Likes
724

Hi,

I have pasted below a code in which it fills the fieldcatalog.

DEFINE m_field.

add 1 to lc_fieldcat-col_pos.

lc_fieldcat-fieldname = &1.

lc_fieldcat-outputlen = &2.

lc_fieldcat-seltext_l = &3.

lc_fieldcat-do_sum = &4.

lc_fieldcat-inttype = &5.

lc_fieldcat-hotspot = &6.

lc_fieldcat-fix_column = &7.

lc_fieldcat-just = &8.

lc_fieldcat-decimals_out = '0'.

lc_fieldcat-ddictxt = 'L'.

lc_fieldcat-no_zero = 'X'.

append lc_fieldcat to %fieldcat.

END-OF-DEFINITION.

m_field 'VBELN' '10' 'Ref Doc' '' '' 'X' '' ''.

m_field 'POSNR' '06' 'Item' '' '' '' '' ''.

m_field 'MATNR' '18' 'Material' '' '' '' '' ''.

m_field 'ARKTX' '40' 'Description' '' '' '' '' ''.

m_field 'KWMENG' '15' 'Quantity' '' '' '' '' 'R'.

m_field 'ZIEME' '3' 'UM' '' '' '' '' ''.

m_field 'LS_LINES2' '132' 'Ship-To' '' '' '' '' ''.

m_field 'LS_LINES3' '132' 'Contact Person' '' '' '' '' ''.

m_field 'LS_LINES4' '132' 'Contact Number' '' '' '' '' ''.

Regards!

Read only

0 Likes
724

Hi Anuradha,

<b>

1</b>.

Define ur Fieldcatalog Itab like

DATA:i_fieldcat TYPE slis_t_fieldcat_alv,

w_fieldcat LIKE LINE OF i_fieldcat,

<b>2</b>.

Populate Fieldcatlog table .

CLEAR :w_fieldcat,

i_fieldcat.

w_fieldcat-fieldname = 'PERNR'.

w_fieldcat-tabname = 'I_IT0002'.

w_fieldcat-seltext_m = 'PERNR'.

APPEND w_fieldcat TO i_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-fieldname = 'ENDDA'.

w_fieldcat-seltext_m = 'ENDDA'.

w_fieldcat-tabname = 'I_IT0002'.

APPEND w_fieldcat TO i_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-fieldname = 'BEGDA'.

w_fieldcat-seltext_m = 'BEGDA'.

w_fieldcat-tabname = 'I_IT0002'.

APPEND w_fieldcat TO i_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-fieldname = 'MASSN'.

w_fieldcat-seltext_m = 'MASSN'.

w_fieldcat-tabname = 'I_IT0002'.

APPEND w_fieldcat TO i_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-fieldname = 'STAT1'.

w_fieldcat-seltext_m = 'STAT1'.

w_fieldcat-tabname = 'I_IT0002'.

APPEND w_fieldcat TO i_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-fieldname = 'STAT2'.

w_fieldcat-seltext_m = 'STAT2'.

w_fieldcat-tabname = 'I_IT0002'.

APPEND w_fieldcat TO i_fieldcat.

CLEAR w_fieldcat.

<b>Thanks,

Venkat.O</b>