Skip to Content
author's profile photo Former Member
Former Member

WDA ALV

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Nov 24, 2011 at 08:42 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2011 at 11:35 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Dec 08, 2011 at 07:04 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.