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: 

Usage of IEQ

zhlish
Explorer
0 Kudos

Hi,

I came across this snippet, but can't understand what is the usage of IEQ.
The wo_kunnr-low will be populated by the kunnr found in the select, but just after that there is my workarea wo_kunnr(3) = 'IEQ'.

From this I shoud get true or false based on what I find on internet, but IEQ which values is comparing in here?

TYPES: BEGIN OF ty_opt,
sign(1) TYPE c,
option(2) TYPE c,
low(50) TYPE c,
high(50) TYPE c,
END OF ty_opt.

DATA: s_kunnr TYPE STANDARD TABLE OF ty_opt,
s_pan TYPE STANDARD TABLE OF ty_opt,
s_card TYPE STANDARD TABLE OF ty_opt,
gt_cards TYPE STANDARD TABLE OF zecc_cards_kunnr,
wo_kunnr like line of s_kunnr.


clear wo_kunnr.
SELECT kunnr INTO wo_kunnr-low FROM ztable_kunnr WHERE
pan IN s_pan.
wo_kunnr(3) = 'IEQ'.
APPEND wo_kunnr to s_kunnr.
ENDSELECT.
SORT s_kunnr.
1 ACCEPTED SOLUTION

Tomas_Buryanek
Active Contributor
7 REPLIES 7

Tomas_Buryanek
Active Contributor

Hi Tomas,

So essencially is equal as:

wo_kunnr-sign = 'I'

wo_kunnr-option = 'EQ'

....

In this case wo_kunnr(3) = 'IEQ' is splitting since SIGN char1 anche OPTION char2

zhlish Correct 🙂

-- Tomas --

0 Kudos

Gererally, any flat character-like structure, like the structure ty_opt here, is handled in the conversion like a single data object of the type character.

Sandra_Rossi
Active Contributor
0 Kudos

Better simplify the writing of TY_OPT (will be the same except that length of LOW and HIGH will be 10, but I think you don't need 50):

TYPES ty_opt TYPE RANGE OF ztable_kunnr-kunnr.

matt
Active Contributor

This is more efficient:

wo_kunnr = 'IEQ'.
SELECT kunnr INTO wo_kunnr-low FROM ztable_kunnr WHERE
      pan IN s_pan.
   APPEND wo_kunnr to s_kunnr.
ENDSELECT.

But even better is

CONSTANTS: c_i  TYPE c LENGTH 1 VALUE 'I',
           c_eq TYPE c LENGTH 2 VALUE 'EQ'.
SELECT @c_i AS sign, @c_eq AS option, kunnr AS low 
    INTO CORRESPONDING FIELDS OF TABLE s_kunnr
    FROM ztable_kunnr
    WHERE pan IN @s_pan.

touzik_itc
Active Participant

If s_kunnr is later used to select data from sometable, than

SELECT * FROM sometable INTO TABLE @DATA(result) WHERE kunnr IN 
  ( SELECT kunnr FROM ztable_kunnr WHERE pan IN @s_pan ).