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

need logic

Former Member
0 Likes
459

hi,

i need some logic

i am retriving data pkps-pkbst based on the value of pkbst

if pkbst value is 1 i have to go

tpksf-sfgs1,

if pkbst value is 2 i have to go

tpksf-sfgs2,like wise

in tpksf-sfgs fields the values are '+','-','.' like that

when it goes to any of tpksf-sfgs value and that value is +

then it has to go the next + value of tpksf-sfgs

points will be rewarded for helpful answers

Regards,

Shaik

3 REPLIES 3
Read only

Former Member
0 Likes
426

Hello ,

Try this :-


1, st get al the data.
2,  loop it.
Loop at itab.
case itab-pkst.
when ''.
read table tpksf with key sfgs1.
do processing.
when '2'.
read table tpksf with key sfgs2
do processing.
when '+'         " here u need to loop
Loop at tpksf.
process.
endloop.
endloop.

Hope this helps.

reward if it helps.

Regards,

Deepu.K

Read only

Former Member
0 Likes
426

Hi,

Ok..Try this..

FIELD-SYMBOLS: <FS>.

DATA: V_FIELD(30).

  • Get from PKPS

SELECT SINGLE PKBST INTO V_PKBST FROM PKPS.

  • Get from TPKSF.

SELECT SINGLE * FROM TPKSF WHERE ... "Give the appropriate condition.

CONCATENATE 'SFGS' V_PKBST INTO V_FIELD.

ASSIGN (V_FIELD) TO <FS>.

WRITE: / V_FIELD, ' name has the value ', <FS>.

Thanks,

Naren

Read only

Former Member
0 Likes
426

Hi

I've not understood your problem very well, anyway I hope thid code can help you

TABLES: PKPS, TPKSF.

FIELD-SYMBOLS: <SFGS>.

DATA: FIELD_INDEX TYPE I.

FIELD_INDEX = PKPS-PKBST + 2.

ASSIGN COMPONENT FIELD_INDEX OF STRUCTURE TPKSF TO <SFGS>.

CASE <SFGS>.
  WHEN SPACE.
  WHEN '-'.
    FIELD_INDEX = FIELD_INDEX - 1.
  WHEN '+'.
    FIELD_INDEX = FIELD_INDEX + 1.
ENDCASE.

IF FIELD_INDEX => 3.
  ASSIGN COMPONENT FIELD_INDEX OF STRUCTURE TPKSF TO <SFGS>.
ENDIF.

Max