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

Most efficient logic based on my selection screen...

aris_hidalgo
Contributor
0 Likes
525

Hello Experts, 

My selection screen's parameters is based on different tables like VBAK, LIKP, MARA and LIPS.
Now, How do I code my select statement since my selection screen is based from different tables?
I want to avoid using JOINS for this scenario.Anyway, below is my selection screen:

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                s_audat FOR vbak-audat,
                s_auart FOR vbak-auart,
                s_bstnk FOR vbak-bstnk,
                s_sold  FOR vbak-kunnr,
                s_ship  FOR likp-kunnr,
                s_spart FOR mara-spart,
                s_matnr FOR vbap-matnr,
                s_charg FOR lips-charg,
                s_dlv   FOR lips-vbeln,
                s_lfdat FOR likp-lfdat.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETERS: rb_local RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND cmd,
            rb_ftp   RADIOBUTTON GROUP grp1.
SELECTION-SCREEN END OF BLOCK b3.
SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS:     p_fname2(60) TYPE c MODIF ID fnb,
                p_fname      TYPE   rlgrap-filename DEFAULT 'c:' MODIF ID fna ,
                p_ip(64)     TYPE c LOWER CASE ,
                p_user(30)   TYPE c LOWER CASE ,
                p_pword(30)  TYPE c LOWER CASE .
SELECTION-SCREEN END OF BLOCK b4.
SELECTION-SCREEN END OF BLOCK b1.

Hope you can help me guys. Thank you and take care!
1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
495

Hi

It is better to declare the Select -options with their Master data tables

where ever it is possible.

Kunnr from KNA1 instead of VBA-kunnr, Matnr from MARA instead of VBAP-MATNR, SPART from TSPA instead of MARA-SPART.

You can join the tables VBAk,VBAP,LIKP,LIPS,MARA and can give all the select -options in the where conditions

that is the efificient way I feel, since the tables Order and Delivery tables can easily be joined.

or first join VBAk,VBAP,MARA and give the VBELn,AUDAT,AUART,BSTNK, SPART from VBAK and then for all entries of this ITAB fetch LIKP and LIPS validating the LIKP-KUNNR,CHARG,VBELN,LFDAT in where condition.

Regards

Anji

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
0 Likes
495

'Now, How do I code my select statement since my selection screen is based from different tables?'

It depends on what you want to select...

Read only

Former Member
0 Likes
496

Hi

It is better to declare the Select -options with their Master data tables

where ever it is possible.

Kunnr from KNA1 instead of VBA-kunnr, Matnr from MARA instead of VBAP-MATNR, SPART from TSPA instead of MARA-SPART.

You can join the tables VBAk,VBAP,LIKP,LIPS,MARA and can give all the select -options in the where conditions

that is the efificient way I feel, since the tables Order and Delivery tables can easily be joined.

or first join VBAk,VBAP,MARA and give the VBELn,AUDAT,AUART,BSTNK, SPART from VBAK and then for all entries of this ITAB fetch LIKP and LIPS validating the LIKP-KUNNR,CHARG,VBELN,LFDAT in where condition.

Regards

Anji

Read only

0 Likes
495

'It is better to declare the Select -options with their Master data tables

where ever it is possible.

Kunnr from KNA1 instead of VBA-kunnr, Matnr from MARA instead of VBAP-MATNR, SPART from TSPA instead of MARA-SPART.'

it does not matter, they are pointing to the same data element...