cancel
Showing results for 
Search instead for 
Did you mean: 

Change column heading in webdynpro editable table

Former Member
0 Kudos

Hi All,

I am new in webdynpro for ABAP.

I need one help from all of you.

I make a editable table in webdynpro for ABAP.

Right now the header comes from database table( from field label )

Now I have a requirement to conert the static header from dynamic header.

It means when i run my program, it will not take header from database table, It will take header from where i have to write code.

Please Help me

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

for every table column Caption is there. U can set that. If that is fixed, means u does not need to chnage anywhere then just hardcode it. otherwise bind it with an attribute of type string and set it's value in doinit.

Former Member
0 Kudos

HI,

I don't want to keep the value fix.

I want to bind the value specific date wise.

Kindly tell me that how i bind my value to the column field.

Former Member
0 Kudos

Hi Narendra,

1. Create an attribute in the context of type string.

2. Bind the caption of that column to that attribute.

Read this attribute through code wizard in the wdinit.

pass the value and then use set_atttribute method of the context node.

That's it.

Former Member
0 Kudos

Hi Boss,

I made a node in my view, In this i add a attribute of type string.

Now i bind the column heading( Caption ) with that attribute.

But now i am unable to read that element and pass the value to column header.

Former Member
0 Kudos

In wdoinit, I write the given below code.

I want to give date of monday as my heading of that column.

data: week_num type SCAL-WEEK,

monday type sy-datum,

sunday type sy-datum.

CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'

EXPORTING

DATE = SY-DATUM

IMPORTING

WEEK = week_num

MONDAY = monday

SUNDAY = sunday

.

data: lo_nd_head type ref to IF_WD_CONTEXT_NODE.

DATA lo_el_head TYPE REF TO if_wd_context_element.

LO_ND_head = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_head ).

  • get element via lead selection

LO_EL_head = LO_ND_head->GET_ELEMENT( ).

  • get single attribute

lo_el_head->set_attribute(

exporting

name = 'MON'

value = monday ) .

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Narender,

We have the Columns under the TABLEUI Element. Every COLUMN under it is associated with Column CAption. Just enter the text as per ur requirement . That's it.

Another way to do that programmatically is

Bind that caption to an attribute in the context. At the Initialization of view, fill that attribute value to the context.

Former Member
0 Kudos

HI,

Is this Normal TABLE UI or ALV.

Regards,

Lekha.

Former Member
0 Kudos

This is normal table not alv.

Former Member
0 Kudos

Hi,

For How many coluns you want this set the header.

Former Member
0 Kudos

Actually i am making a time sheet which is on weekly basis.

Right now i am using Headers as 'Monday' , 'Tuesday'.............'Sunday'

I have total 13 headers but Only in 7 headers I want date in respect of day.

Former Member
0 Kudos

HI,

One more thing is This a Dynamic node.

If it is a static node,

Create an attribute for colname as string.

Then, for the those columns,

Bind the col heading to this field. Populate this field as per your requirement.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

I can't understand what you want ro say.

I made an attribute column of type string.

Afterwords How I should proceed

Former Member
0 Kudos

Hi,

Bind the attribute to one of the columns to which you want toset the header.

Now populate this field.

loop at lt_table into ls_table.

ls_table-str = 'Monday'.

endloop.

Bind this table to node.

Regards,

Lekha.

Former Member
0 Kudos

Where i have to write the above block of brogram

Former Member
0 Kudos

Hi,

You can write it where you have bound the internal table. I donot know your requirement. Youcan either write it in WDODOINIT or

HANDLERplug of the view.

Regards,

Lekha.