2010 Aug 09 5:32 AM
Hi
method ME_PROCESS_REQ_CUST~check.
READ TABLE t_mereq_item_exkn_cj40 INTO w_mereq_item_exkn_cj40 INDEX sy-tabix.
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
IF sy-subrc = 0.
MESSAGE e210(zgea) WITH w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result.
ENDIF.
ENDIF.
endmethod.
the above loop if satisfies the condition displayes an error messages.
but If the loop come with three items , in the message popup it should show three errors with the line items.
It works fine with one line item.
multiple line item errors are not pupulating the in the error box.
How to achieve?
I have isplayed the Error messages in Message class.
Hi
method ME_PROCESS_REQ_CUST~check.
READ TABLE t_mereq_item_exkn_cj40 INTO w_mereq_item_exkn_cj40 INDEX sy-tabix.
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
IF sy-subrc = 0.
MESSAGE e210(zgea) WITH w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result.
ENDIF.
ENDIF.
endmethod.
the above loop if satisfies the condition displayes an error messages.
but If the loop come with three items , in the message popup it should show three errors with the line items.
It works fine with one line item.
multiple line item errors are not pupulating the in the error box.
How to achieve?
I have isplayed the Error messages in Message class.
2010 Aug 09 5:45 AM
Hi,
Try like belwo.
Take out the SY-SUBRC condition.
BUt u r not using any LOOP.ENDLOOP here.
READ TABLE t_mereq_item_exkn_cj40 INTO w_mereq_item_exkn_cj40 INDEX sy-tabix.
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
MESSAGE e210(zgea) WITH w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result.
ENDIF
regards,
Pravin
2010 Aug 09 5:56 AM
Nop pravin
i have tried
not working
READ TABLE t_mereq_item_exkn_cj40 INTO w_mereq_item_exkn_cj40 INDEX sy-tabix.
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
MESSAGE e210(zgea) WITH w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result.
ENDIF.
ENDIF.
loop at t_mereq_item_exkn_cj40 INTO w_mereq_item_exkn_cj40 INDEX sy-tabix.
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
MESSAGE e210(zgea) WITH w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result.
ENDIF.
ENDIF.
endloop.
tried both the code. But it is not working
2010 Aug 09 6:38 AM
Hi Muthu,
Can u try like this?
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
LOOP AT t_mereq_item_exkn_cj40 INTO w_mereq_item_exkn_cj40 .
MESSAGE e210(zgea) WITH w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result.
ENDLOOP.
ENDIF.
2010 Aug 09 6:49 AM
no praveen
it will not display , it wont display even for a single line item.
2010 Aug 09 7:16 AM
put the if condition inside the loop.
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
and also chek the u have vaild test data.
chek in debugging mode how many records u r getting in INternal table and how many of them are satisfying the above if cos\ntion.
Other wise
chage the records in debigging mode and satify the above if condition and see how many messages you re getting.
Reagrds,
Pravin
Edited by: pravin s. on Aug 9, 2010 8:16 AM
2010 Aug 09 11:33 AM
Hi ;
In your two methods, I can see you are using sy-tabix in both cases.
Is your method already called within a loop and you were trying to pass the current index value of that loop to your method?
if that, is the sy-tabix populated with your desired or correct line index value and use it in your logic to read the values?
Try to put a breakpoint within the method and check that?
Regards
2010 Aug 09 7:29 AM
Hello Muthu,
You can collect your message texts (using MESSAGE ... INTO) into a internal table & then display these lines in a single popup using 'POPUP_DISPLAY_TEXT_WITH_PARAMS'.
Not sure if this BAdI is triggered at line item level or the document level. Can you elaborate on this ?
BR,
Suhas
2010 Aug 09 8:19 AM
Hi suha
The scenario is
in purchase requsitions
there are three line items.
Line item has Quantity - menge.
Account aassignmet has WBS element.
i have three line diefferent line item and for each line item i have Differet WBS which holds some particular quantity from budget.
comparing that budget quantity with line item menge for each and every time. if it is more then have to display the error messae. with all the ilne items etails
Thank
This badi trigereing for the whole PR in check method.
2010 Aug 09 10:10 AM
Hi Muthu,
Loop at t_mereq_item_exkn_cj40 INTO w_mereq_item_exkn_cj40.
IF w_mereq_item_exkn_cj40-menge GT w_mereq_item_exkn_cj40-result.
IF sy-subrc = 0.
MESSAGE e210(zgea) WITH w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result.
*Capture the message into an internal table itab instead of giving the error message.
concatenate w_mereq_item_exkn_cj40-bnfpo w_mereq_item_exkn_cj40-psp_pnr w_mereq_item_exkn_cj40-result
into text
separated by space.
append text to itab.
ENDIF.
ENDIF.
endloop.
if itab is not initial.
Use FM POPUP_WITH_TABLE_DISPLAY to display all the messages,
Then provide one dummy error message to stop further processing.
endif.
Regards,
Dwarakanath.S
2010 Aug 21 5:25 AM
2010 Aug 21 2:54 PM
2011 Jan 27 6:45 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |