Application Development 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: 

Error handling in ALV grid for success and failure messages thru pop-up

Former Member
0 Kudos

Hi Friends,

I have a ALV grid report (REUSE_ALV_GRID_DISPLAY) which creates Sales Order thru bapi (BAPI_SALESORDER_CREATEFROMDAT2). Initially my requirement is to create one SO at a time for customer-material combinations. If the sales order is created sucessfully I gave a status message saying that " SO 123 created sucessfully for customer ABC". Till here it is working fine.

My requirement changed in such a way that - Lets say I have 8 different customers with different materials. I need to create the sales order for the selected customers. For that I created a checkbox coloum in my report and if user selects what ever customers she needs, it will create a sales order for that customers only. If she selects 3 different customers out of 8, three sales orders will be created.(It is working fine till here too).

My question is, let's say among the 3 different customers selected 2 sales order got created sucessfully and 1 has some error. I need to show the sucess or failure messages in a pop-up ALV which I should be able to save the information from pop-up to presentation server.

My thoughts were - Get the success and error messages into a table and display that table thru some pop-up ALV FM.

But , how do I need to loop thru the sucess and failure messages and Is there any FM for pop-up ALV display? Sugest me if I am wrong here.

Example:

1. Sales document 123 created sucessfully for customer ABC.

2. Sales document not created sucessfully for customer EFG.

3. Sales document 901 created sucessfully for customer IJK.

Please guide me/help me hoe to achieve this. Sample code snippet is appreciable.

Thanks.

8 REPLIES 8

Former Member
0 Kudos

Look at FM REUSE_ALV_POPUP_TO_SELECT

Rob

Former Member
0 Kudos

Nani,

You have posted the same question and myself and Sandra Rossi replied to your questions.

@Rob : The reason why I didnt suggested him "REUSE_ALV_POPUP_TO_SELECT" in the above thread was that the option to download the output was required, hope you agree.

0 Kudos

Yes - I missed that.

@nani - please close one of these threads and assign some points to those that helped.

Rob

0 Kudos

Hi Suman and Rob,

Yes. I have created a thread for the same last week. But when I tried to open my thread, I see a message saying that "this thread is no longer in use". So, I posted a new one.

Please see my code below.

TYPES:
BEGIN OF GTY_LOGS_USAGE,
MESSAGE1(100),
MESSAGE2(100),
MESSAGE3(100),
END OF GTY_LOGS_USAGE.

DATA:
IT_LOGS_USAGE TYPE STANDARD TABLE OF GTY_LOGS_USAGE,
WA_LOGS_USAGE TYPE GTY_LOGS_USAGE.

DATA:
L_TABNAME TYPE SLIS_TABNAME,
I_STRUCTURE_NAME LIKE DD02L-TABNAME,
SELECTION TYPE SLIS_SELFIELD,
IT_LOGS    TYPE SLIS_T_FIELDCAT_ALV,       "internal table for field catalog
WA_LOGS   TYPE SLIS_FIELDCAT_ALV,         "work area for field catalog
EXIT_FLAG.


       CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
          EXPORTING
           I_TITLE                       = 'Logs for sucess and error messages'
           I_SELECTION                   = 'X'
*           I_ALLOW_NO_SELECTION          =
*           I_ZEBRA                       = ' '
*           I_SCREEN_START_COLUMN         = 1
*           I_SCREEN_START_LINE           = 1
*           I_SCREEN_END_COLUMN           = 1
*           I_SCREEN_END_LINE             = 1
*           I_CHECKBOX_FIELDNAME          =
*           I_LINEMARK_FIELDNAME          = 'COLOUR'
           I_SCROLL_TO_SEL_LINE          = 'X'
            I_TABNAME                     = 'IT_LOGS_USAGE'  
           I_STRUCTURE_NAME              = 'IT_LOGS_USAGE'
           IT_FIELDCAT                   = IT_LOGS[]
*           IT_EXCLUDING                  =
           I_CALLBACK_PROGRAM            = GD_REPID
           I_CALLBACK_USER_COMMAND       = 'USER_COMMAND'
*           IS_PRIVATE                    =
*         IMPORTING
*           ES_SELFIELD                   = SELECTION
*           E_EXIT                        = EXIT_FLAG
        TABLES
          T_OUTTAB                      = IT_LOGS_USAGE
*         EXCEPTIONS
*           PROGRAM_ERROR                 = 1
*           OTHERS                        = 2.

There is a value in my IT_LOGS_USAGE. When I click the custom push button for the logs to display, I see a pop-up but, I don't see any value in my pop-up. Am I doing anything wrong?

Please suggest.

0 Kudos

Hi Suman and Rob,

Yes. I have created a thread for the same last week. But when I tried to open my thread, I see a message saying that "this thread is no longer in use". So, I posted a new one.

I have never heardd of or seen such a message. Anyway, I marked it as assumed answered. You can still go back and assign polnts.

Please do.

Rob

0 Kudos

Hi Rob,

I have pasted my code above. Get a chance, I would really appreciate if you could suggest me if I have done anything wrong.

Thanks.

0 Kudos

Well, as Suman Jagu pointed out, this won't allow you to do a download.

Rob

0 Kudos

You might have a look at fm WLF_PRINT_ERROR_MESSAGES_LIST

Rob