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

Badi-Issue

jaheer_hussain
Active Contributor
0 Likes
766

Hi,

I am working with one Badi implementation in development system.

Badi: MM_RESERVATION_BADI and
Implementation name :ZZ_MM_RESERVATION.

  Below is my coding:

 

method IF_EX_MB_RESERVATION_BADI~DATA_CHECK.

  SELECT SINGLE * FROM MARC WHERE MATNR EQ IS_RESB-MATNR AND WERKS EQ IS_RESB-WERKS.

  

   IF MARC-DISMM EQ 'ND'.  "(DISMM-MRP type is equal ND)

     MESAAGE 'This material has MRP TYPE ND,please contact Emad-Warehouse',E.

endmethod.

Can some throw light on this issue,please?

Note:I am new to Badi development.

with Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
695

Dear Mr. Hussain,

You need to define a data-structure, which has the same structure like the table. In this structure you have to assign the data of the select.

Your code could look like:


Data: ls_marc type marc.

Select single * from marc into ls_marc where...

Please keep in mind that select * does not have a good performance. Better select only the needed attributes.

Kind regards,

Benjamin

2 REPLIES 2
Read only

Former Member
0 Likes
696

Dear Mr. Hussain,

You need to define a data-structure, which has the same structure like the table. In this structure you have to assign the data of the select.

Your code could look like:


Data: ls_marc type marc.

Select single * from marc into ls_marc where...

Please keep in mind that select * does not have a good performance. Better select only the needed attributes.

Kind regards,

Benjamin

Read only

ashraf_usmani
Participant
0 Likes
695

hi

Please  explore more your problem

correct your select

SELECT * UP TO 1 ROW INTO TABLE ITAB

                FROM MARC

                WHERE MATNR EQ IS_RESB-MATNR

                AND WERKS EQ IS_RESB-WERKS.


Regards

Ashraf Usmani