cancel
Showing results for 
Search instead for 
Did you mean: 

WDA ALV

Former Member
0 Kudos

Hi,

I have a Ztable with a field ZSTATUS,this field contains fixed values

1 Pending with Approver 1

2 Pending with Approver 2

3 Approved

0 Rejected

The data is displayed using ALV Table in WebDynpro ABAP

My requirement is now am getting the output for the coulmn ZSTATUS as 1 or 2 or 3 etc

But the values of the field ZSTATUS should be if ZSTATUS = '1' then it should contain this text Pending with Approver1 ,

if ZSTATUS = '2' then it should contain this text Pending with Approver2. etc...........

The values for the ZSTATUS field should be dynamically changed.

I have retrieved the coulmn by this logic,

*lr_column_settings ?= l_value.

*lr_column = lr_column_settings->get_column( 'ZSTATUS' ).

After this I need the cell value if it is 1 then the text should be Pending with Approver 1.

How to retrieve the cell value for a field in WebDynpro ABAP ALV.

Thanks in advance,

Jyoti

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The issue was solved.

Here is the Logic.

1.I created a new field in Ztable for the Status Description with char(25).

2.After reading the node.

2.Then added the new field to the Itab.

3.Then checked the Status value using CASE Condition.

LOOP AT itab INTO wa.

CASE wa-ZSTATUS.

WHEN '1'.

MOVE 'Pending with Approver 1' TO wa-ZSTATUS_DESC.

WHEN '2'.

MOVE 'Pending with Approver 2' TO wa-ZSTATUS_DESC.

WHEN '3'.

MOVE 'Approved' TO wa-ZSTATUS_DESC.

WHEN '0'.

MOVE 'Rejected' TO wa-ZSTATUS_DESC

ENDCASE.

MODIFY itab FROM wa TRANSPORTING ZSTATUS_DESC.

CLEAR wa.

ENDLOOP.

Regards,

Jyoti

Former Member
0 Kudos

Hi jothi ,

As you have mentioned above by using lr_column_settings and lr_column you will not be able to get the value of a field.

These are being used to get column reference of a column.

Basically these are used to implement various functionality like input field , drop down in a particular column.

To get the value of a cell you need to define cell events in methods.

Like in case if your 'ZSTATUS' field is displayed as a input field you can get the value of the cell in the 'ON_DATA_CHECK'

event handler where you will get the value of the field and you can code according to your need.

Specify if any help required.

Regards,

Monishankar C

Former Member
0 Kudos

Hi Sahai & Monish,

Thanks for your updates.

The issue was solved.

Here is the Logic.

1.I created a new field in Ztable for the Status Description with char(25).

2.After reading the node.

2.Then added the new field to the Itab.

3.Then checked the Status value using CASE Condition.

LOOP AT itab INTO wa.

CASE wa-ZSTATUS.

WHEN '1'.

MOVE 'Pending with Approver 1' TO wa-ZSTATUS_DESC.

WHEN '2'.

MOVE 'Pending with Approver 2' TO wa-ZSTATUS_DESC.

WHEN '3'.

MOVE 'Approved' TO wa-ZSTATUS_DESC.

WHEN '0'.

MOVE 'Rejected' TO wa-ZSTATUS_DESC

ENDCASE.

MODIFY itab FROM wa TRANSPORTING ZSTATUS_DESC.

CLEAR wa.

ENDLOOP.

Regards,

Jyoti

sahai
Contributor
0 Kudos

Hi jothi lakshmi,

what you exactly want to know? have you binded the value of 'ZSTATUS' or not?

please elaborate your question and also tell me the data element of your ZSTATUS field

it will help me to guide you better.

Regards,

Sahai.S

Former Member
0 Kudos

Hi Sahai,

I have binded the value of Status and am getting the output too.

The need is to change the coulmn content of Status field dynamically at runtime in WDA ALV Table.

The data element for ZSTATUS is ZMM_DE_STATUS.

Thanks,

Jyoti

sahai
Contributor
0 Kudos

Hi Sahai,

>

> I have binded the value of Status and am getting the output too.

>

> The need is to change the coulmn content of Status field dynamically at runtime in WDA ALV Table.

>

> The data element for ZSTATUS is ZMM_DE_STATUS.

>

> Thanks,

> Jyoti

please tell me the data type of domain "ZMM_DE_STATUS" . also are you getting the value displayed in alv for this coulmn?

regards,

sahai.s

Former Member
0 Kudos

Hi Sahai,

Field ZSTATUS

Domain ZMM_DO_STATUS

Data Element ZMM_DE_STATUS

Am getting the output for this field in ALV Table.

Now the output is like 1,2,3

but I need output for this field value as 1 for Approve pending 1

2 for Approve pendin 2

3 for Approved

0 for Rejected

Mean Instead of Numbers in the output I need these texts to be displayed.

Thanks,

Jyoti

sahai
Contributor
0 Kudos

Hi Sahai,

>

> Field ZSTATUS

> Domain ZMM_DO_STATUS

> Data Element ZMM_DE_STATUS

>

> Am getting the output for this field in ALV Table.

>

> Now the output is like 1,2,3

> but I need output for this field value as 1 for Approve pending 1

> 2 for Approve pendin 2

> 3 for Approved

> 0 for Rejected

>

> Mean Instead of Numbers in the output I need these texts to be displayed.

>

> Thanks,

> Jyoti

OK .... JUST GO TO SE11 AND CHECK THE DATA TYPE OF ZMM_DO_STATUS I THINK THE TYPE IS INTEGER . YOU NEED TO CHANGE IT FIRST TO CHAR.

if you cannot change the dataelement just make the type of zstatus in your application to char.

after doing so

all you need is to read the node as a table , as you told that the alv is getting displayed so once you read the node with which you have binded the alv you will get the value i.e 1,2,3...etc . and according to the the value you can loop at the internal table and change the value according to your need.

Regards,

Sahai.S