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

display as log

former_member671224
Participant
0 Likes
1,091

Hi all,

Im doing some validation in the program, and saving the result in internal table. Based on the validation internal table contains messages as well as status ('E' or 'S'). Can i display it in ALV as a pop-up with button for status as red for 'E' and green for 'S'? Can you please tell how can we display like that?

Thanks,

Amal

Hi all,

Im doing some validation in the program, and saving the result in internal table. Based on the validation internal table contains messages as well as status ('E' or 'S'). Can i display it in ALV as a pop-up with button for status as red for 'E' and green for 'S'? Can you please tell how can we display like that?

Thanks,

Amal

11 REPLIES 11
Read only

Former Member
0 Likes
1,056

Use:

Function Modlue: REUSE_ALV_POPUP _ TO _ SELECT

OR

It will just give popup..

Message 'XXXX' TYPE 'E' DISPLAY LIKE 'I'.

Message 'XXXX' TYPE 'S' DISPLAY LIKE 'I'.

Regards,

Gurpreet

Read only

0 Likes
1,056

for one field(status) , need to display as button, if the value is 'E' red button and if the value is 'S' green button.

Read only

0 Likes
1,056

Hi Amal,

Once you give

message XXXX type 'S' or TYPE 'E'.

the system variable sy-msgty is set which gives the type of the messages displayed..

there is another way you can also store the messages by declaring a table with the structure type

bdcmsgcoll , which will also hold type of the message by msgty field...

use if conditions...

if sy-msgty = 'S'.
"  logic to display green button
else sy-msgty = 'E'
"  logic to display red button
endif.

Regards,

Siddarth

Edited by: Siddharth Chordia on Mar 14, 2009 11:19 PM

Read only

Former Member
0 Likes
1,056

let me try to understand ur requirement first,

u want to collect ur messages into a table and display them right,

and what abt buttons, u mean icons , red and green icons?

i did not understand by colored buttons.

Read only

0 Likes
1,056

yes, its colored Icons.

Now im thinking of displaying it as application log. can you tell me how to display our own(custom) mesage as long text?

i.e., Im displaying message as application log for error and success message types. But for error message type i need to give more information like what the next action to be taken to resolve the error. Thinking of having that in long text option. but i dont know how give custom message as long text.

Can anyone let me know how to do this?

Thanks,

Amal

Read only

0 Likes
1,056

Hi Amal,

First of all, you are breaking the rules of SDN....

Rule says every new question has to be asked in the new thread,

For the answer to your question is as follows....

To create a long text....

you need to follow certain steps by which you can achieve the requirement...

1. Go to SE91, create your own custom message class. ( say you are creating by name yamal )

2. do not enter any messages in that just create it and give the short text for it that all, save and activate it.

3. now go to your program...

the place where you are writing

message 'XXXX' type 'S' or type 'E'.

comment this line and copy 'XXXX'.

then write ( say for example the message type was 'S' ) then

message s001(yamal).

now double click on yamal it will take you to the message class and 001 row...

now paste the 'XXXX' which you copied from message....

at the right of the row 001 you will find one push button

click on it

there you can enter long text for the message....

next time for another message you want a long text

write

message e002(yamal).

double click and follow the same procedure...

REMEMBER : every new message should appear on a new line.

Regards,

Siddarth

Read only

0 Likes
1,056

i dont think he's breaking rules. Asking multiple different questions is not allowed but his questions are interrelated they both actually point to same requirement . Isn't it?

So i think continuing in same thread is fair enough.

Read only

0 Likes
1,056

I think if moderators look at it, then it would be fair enough...

Read only

0 Likes
1,056

Siddharth,

Is it possible to pass the value dynamically to long text?

i.e., In message using 'WITH' we can pass the dynamic values to message. We can replace the & with values dynamically. Same can we do for ling text?

Thanks,

Amal

Read only

Former Member
0 Likes
1,056

Hi Amal,

You can use Function Module:

REUSE_ALV_POPUP_TO_SELECT,

Where in that set PF status by this and add button on it:



FORM pf_status USING rt_extab TYPE slis_t_extab.
 
  SET PF-STATUS 'FIRST'.
 
ENDFORM.                    "PF_STATUS
 

Then capture the user command of the button added through pf-status:


 
FORM comm USING ucomm LIKE sy-ucomm selfield TYPE slis_selfield.
 
  DATA: okcode TYPE sy-ucomm.
 
  okcode = ucomm.
  CASE okcode.
 
    WHEN 'REF'.
    CALL FUNCTION 'POPUP_TO_INFORM'
      EXPORTING
        titel         = 'MANSI'
        txt1          = 'CREATED BY'
        txt2          = SY-UNAME
*       TXT3          = ' '
*       TXT4          = ' '
 
              .
 
endcase.
 

And then in the function module,REUSE_ALV_POPUP_TO_SELECT

Hope it helps

Regrds

Mansi

Read only

former_member671224
Participant
0 Likes
1,056

Used application log.