cancel
Showing results for 
Search instead for 
Did you mean: 

ALV LAYOUT configuration in Webdynpro abap

Former Member
0 Kudos

Hi All,

I am new to webdynpro abap. I have 8 fields in internal table. Inistead of displaying internal table fields, it is displaying all fields in table BKPF. Is there any field catalog to display internal table fields.

Please help me out.

Thanks & Regards,

N. HARISH KUMAR

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Issue is resolved by myself. In node, we have a option 'Dictionary Structure'.

Here I passed BKPF in Dictionary Structure. So, it is displaying all fields of BKPF in my ALV webdynpro output.

I removed BKPF from that structure. Now it is displaying as per my Node attributes.

I am very thankful for your suggestions and your suggestions helps me to resolve other issues.

Thanks & Regards,

N. HARISH KUMAR

Answers (2)

Answers (2)

veerababu_alladi
Explorer
0 Kudos

Hi harish,

fieldcatalog in the sense, we can modify the alv table column names by using below code.

you can select whatever fiels you want in table.

DATA LO_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.

LO_CMP_USAGE = WD_THIS->WD_CPUSE_ALV2( ).

IF LO_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.

  LO_CMP_USAGE->CREATE_COMPONENT( ).

ENDIF.

DATA LO_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE .

LO_INTERFACECONTROLLER =   WD_THIS->WD_CPIFC_ALV2( ).

  DATA LO_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

  LO_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(

  ).

  LO_VALUE->IF_SALV_WD_TABLE_SETTINGS~SET_VISIBLE_ROW_COUNT( 5 ).

    • for title

DATA: LR_TABLE_SETTINGS TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.

DATA: LR_HEADER TYPE REF TO CL_SALV_WD_HEADER.

LR_TABLE_SETTINGS ?= LO_VALUE.

LR_HEADER = LR_TABLE_SETTINGS->GET_HEADER( ).

LR_HEADER->SET_TEXT( 'Waiting for Travel Advance Approval ' ).

**lr_table_Settings->set_Read_only( abap_false ).

DATA L_HEADER TYPE REF TO CL_SALV_WD_COLUMN_HEADER.

DATA: LO_COLUMN1 TYPE REF TO CL_SALV_WD_COLUMN.

LO_COLUMN1 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'TRAVELID' ).

L_HEADER = LO_COLUMN1->GET_HEADER( ).

L_HEADER->SET_TEXT( 'Travel Adv ID' ).

DATA: LO_COLUMN2 TYPE REF TO CL_SALV_WD_COLUMN.

LO_COLUMN2 = LO_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'PERNR' ).

L_HEADER = LO_COLUMN2->GET_HEADER( ).

L_HEADER->SET_TEXT( 'Employee Name' ).

.

.

.

.

In get_column you have to pass the attribute name

is this what you are looking?

Thanks,

Veerababu.

former_member198833
Active Participant
0 Kudos

Hi Harish,

The Table UI Element will display as many fields you configure it to. You can do it by binding it to a Context Node or manually creating columns. The framework will only bind the internal tables fields that are present on the table you created.

It is recommended to create a Context Node with the Table structure you wish and then use the table as structure layout for the internal table on run time. You can achieve this with the following example:

itab TYPE wd_this->Elements_YourNodeName.

Thus, you will have a 'itab' internal table with the exact same structure as the Context Node.

Regards,

Felipe

Former Member
0 Kudos

Hi Felipe,

I tried as you suggested, but still it is displaying all fields of BKPF.

NODE NAME : BKPF

DATA : gt_bkpf TYPE wd_this->elements_bkpf.

Thanks & Regards,

N. HARISH KUMAR

former_member198833
Active Participant
0 Kudos

Hi Harish,


Are all those fields maintained in the Node BKPF? Could you share the Node structure of BKPF?


Regards,

Felipe

Former Member
0 Kudos

Hi,

Please find the attachment.

Thanks & Regards,

N. HARISH KUMAR

former_member198833
Active Participant
0 Kudos

Hi Harish,

The Node looks correct. How are you maintaing ALV catalog field?

Are you using method CL_ABAP_STRUCTDESCR=>DESCRIBE_BY_DATA to fetch the fields from the internal table and not from BKPF?

Regards,

Felipe