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

Discard record

0 Likes
1,374

Hi,

i have a request in report: Enter in LFA1 with LIFNR extracted at first selection (from table Ekko)

If for each EKKO-LIFNR, no data are extracted from LFA1, discard the record.

How to do this ? Thank youi.

Hi,

i have a request in report: Enter in LFA1 with LIFNR extracted at first selection (from table Ekko)

If for each EKKO-LIFNR, no data are extracted from LFA1, discard the record.

How to do this ? Thank youi.

4 REPLIES 4
Read only

former_member34
Product and Topic Expert
Product and Topic Expert
0 Likes
1,300

Thank you for visiting SAP Community to get answers to your questions. Since you're new in asking questions here, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides tips for preparing questions that draw responses from our members. For example, you can outline what steps you took to find answers (and why they weren't helpful), share screenshots of what you've seen/done, make sure you've applied the appropriate tags, and use a more descriptive subject line. The more details you provide, the more likely it is that members will be able to assist you. You should also make sure you're using all the appropriate tags, so the right experts can find your question.

Should you wish, you can revise your question now by selecting Actions, then Edit.

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS . By personalizing your profile with a photo of you, you encourage readers to respond.

Best regards

Jennifer

SAP Community moderator

Read only

BUTZ
Explorer
0 Likes
1,300

Hello Francesco,

I'm not sure if I got your request Right,

but when you use an Inner Join , you will be get only an result when both table contain a valid entry:

Select ek~* into @DATA(wa_ekko)

from EKKO as EK

inner join LFA1 as LF

on ek~lifnr = lf~lifnr

where lf~lifnr in @So_lifnr. " Select-option

Regards Oliver

Read only

Abinathsiva
Active Contributor
1,300

Question is not clear

Read only

0 Likes
1,300

Sorry.

This is my selection screen:

SELECTION-SCREEN: BEGIN OF BLOCK b0 WITH FRAME.

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.

PARAMETERS: rb_itm RADIOBUTTON GROUP rg1 DEFAULT 'X' USER-COMMAND rg1. PARAMETERS: rb2 RADIOBUTTON GROUP rg1.

PARAMETERS: p_bukrs TYPE ekko-bukrs OBLIGATORY.

SELECT-OPTIONS: s_ebeln FOR ekko-ebeln,

s_lifnr FOR ekko-lifnr,

s_aedat FOR ekko-aedat,

s_matnr FOR ekpo-matnr,

s_etenr FOR eket-etenr MODIF ID g1.

SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: END OF BLOCK b0.

LOAD-OF-PROGRAM.

INITIALIZATION.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name CS 'S_ETENR' AND rb_itm EQ 'X'.

screen-input = 0.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

And my task is:

Extractions

1 – enter in EKKO with:

BUKRS = P_BUKRS

EBELN = S_EBELN

LIFNR = S_LIFNR

If no record is found, show the error “No Data found”

2 – Enter in EKPO with EBELN extracted above and

MATNR = S_MATNR

If no record is found, show the error “No Data found”

3 – Enter in LFA1 with LIFNR extracted at first selection

If for each EKKO-LIFNR, no data are extracted from LFA1, discard the record

4 - Enter in MARA with MATNR extracted at second selection.

If for each EKPO-MATNR, no data are extracted from MATA, discard the record

5 - Enter in MAKT with MATNR extracted at fourth selection and:

SPRAS = SY-LANGU

6- if Radiobutton RB_SCHED is selected, enter in EKET with EBELN and EBELP extracted above.

Output Alv:

Using the FM REUSE_ALV_GRID_DISPLAY, generate the following output:

If radiobutton RB_ITM is selected, create the output with following fields:

EKKO-BUKRS

EKKO-AEDAT

EKKO-LIFNR

LFA1-NAME1

LFA1-LAND1

EKPO-EBELN

EKPO-MATNR

MAKT-MAKTX

EKPO-MENGE

EKPO-MEINS

If radiobutton RB_SCHED is selected, create the output with following fields:

EKKO-BUKRS

EKKO-AEDAT

EKKO-LIFNR

LFA1-NAME1

LFA1-LAND1

EKPO-EBELN

EKPO-MATNR

MAKT-MAKTX

EKPO-MENGE

EKPO-MEINS

EKET-ETENR

EKET-EINDT

EKET-WMENG