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

Regarding Internal Table Manipulation

Former Member
0 Likes
1,146

Hi All,

1. While reading an internal table can't we check against 2 fields which are having Date & time.

The TD Part is as follows.

<b>Read the internal table I_ZBE_RULES for the values of I_ZBE_RULES-LRNDT < I_EKBE_TAB-CPUDT and I_ZBE_RULES-LRNTM < I_EKBE_TAB-CPUTM</b>

2. Also can anybody explain what TD i can write for following point that is in FD. What is the logic for below!

<b>Read KONV table with the EKKI - KNUMV

Select records ONLY where KONV – KSCHL = ZBE_RULES - CR2. Read ZBE_Rules by Sr # = 02, FRICEID = ‘Zxxx’, CR2= ’select all CR2 (Values can be more than one record’ .)</b>

If anybody knows the solution please give reply.

Your answer will be appreciated.

Thanks in advance.

Thanks & Regards,

Rayeez.

11 REPLIES 11
Read only

suresh_datti
Active Contributor
0 Likes
1,099

Hi Shaik,

First off, you can use the READ statement only for equality & not > or <.

try the following..


 1.loop at I_ZBE_RULES where LRNDT < I_EKBE_TAB-CPUDT     and LRNTM < I_EKBE_TAB-CPUTM.
* do your processing
endloop.

Regards,

Suresh Datti

Read only

athavanraja
Active Contributor
0 Likes
1,099

1. read table itab into itab_wa with key fielda = '123' fieldb = '345' .

(note there is no and)

Regards

Raja

Read only

0 Likes
1,099

Hi,

Can anybody tell me the code for below FD part!

Thanks for prevoius replies.

<b>Read KONV table with the EKKI - KNUMV

Select records ONLY where KONV – KSCHL = ZBE_RULES - CR2. Read ZBE_Rules by Sr # = 02, FRICEID = ‘Zxxx’, CR2= ’select all CR2 (Values can be more than one record’ .)</b>

How we can write code for above statements.

Just tell me the code part.

Thanks & Regards,

Rayeez.

Read only

0 Likes
1,099

Hi,

nead some clarification, it is some what confusing. can you make it clear. KNOV are you doing normal select, or internal table.

Regards

vijay

Read only

0 Likes
1,099

Hi,

As per your reply i am posting entire step.

Actually KONV will also be filled in this into I_KONV.

<b>Read EKPO where EKPO-EBELN & EKPO-EBELP like records from itab-EBELN & itab EBELP

Read EKKI – KNUMV to get the Doc condition # for the P.O/LI in itab

Append itab with the EKKI-KNUMV

Read KONV table with the EKKI - KNUMV

Select records ONLY where KONV – KSCHL = ZBE_RULES - CR2. Read ZBE_Rules by Sr # = 02, FRICEID = ‘Zxxx’, CR2= ’select all CR2 (Values can be more than one record’ .)

***Note KONV table also will have more than 1 record for one P.O/Line item.

Not all P.O/LI stored in itab after all the above reads may have records in KONV. Estimated 10% of the P.O will have Spl Cghs Cond Types.

Append itab with KONV– KWERT, KONV-LIFNR per each KONV-KSCHL (Due to one to many situation here replcate other data in itab)</b>

I had posted entire step.

the itab here will be filled before this step from EKBE table.

Please try to solve my issue.

Thanks & Regards,

Rayeez.

Read only

0 Likes
1,099

Hi,

READ table it_ekko with key eblen = itab-ebeln

ebelp = itab-ebelp.

if sy-subrc = 0.

read table it_ekki with key ebeln = it_ekko-ebeln

ebelp = it_ekko-ebelp.

if sy-subrc = 0.

itab-knumv = it_ekki-knumv.

modify itab exporting knumv. "not sure is this you want

loop at it_konv where knumv = it_ekki-knumv.

...

...

read ZBE_RULES table here...

..

endloop.

endif.

endif.

Regards

Vijay

Read only

0 Likes
1,099

Hi,

There will be multiple records in <b>itab</b>.

IN that case will the below logic work!

Thanks & Regards,

Rayeez.

Read only

0 Likes
1,099

Then in that case you need to use this logic inside loop of itab.

i.e

loop at itab.
"the above logic.

endloop.

Regards

vijay

Read only

0 Likes
1,099

Hi,

For the above FD part i am posting TD part.

Please correct me if anything is wrong!

<b>Process 3 – Fetch Special charges from Purchase orders

3.1a) - Check if P.O’s have Special charges

&#61656; For all records of internal table I_EKBE_TAB, Retrieve EBELN and EBELP from table EKPO for values of EKPO-EBELN = I_EKBE_TAB-EBELN and EKPO-EBELP = I_EKBE_TAB-EBELP and then store in internal table I_EKPO. If successful, perform below point

&#61656; For all records of internal table I_EKBE_TAB, Retrieve KNUMV from table EKKI for values of EKKI-EBELN = I_EKBE_TAB-EBELN and EKKI-EBELP = I_EKBE_TAB-EBELP and then store in internal table I_EKKI. Then Modify I_EKBE_TAB-KNUMV with I_EKKI-KNUMV based on EBELN,EBELP of I_EKKI.

&#61656; For all records of table I_EKKI, Retrieve KNUMV, KSCHL, LIFNR and KWERT from table KONV for values of KONV-KNUMV = I_EKKI-KNUMV and then store in internal table I_KONV.

&#61656; Retrieve FRICEID, SEQNUM, SEQITEMNUM, VAR, CR1, CR2, CR3, LRNDT, LRNTM from ZBE_RULES for values of SEQNUM = 02, FRICEID = ‘ZFFIE1908_INVOICE_PARK’ and then append into internal table I_ZBE_RULES.

&#61656; Then build a range for CR1 from internal table values I_ZBE_RULES.

&#61656; Then build a range for CR2 from internal table values I_ZBE_RULES.

&#61656; Then build a range for CR3 from internal table values I_ZBE_RULES.

&#61656; Looping at all the records in I_ZBE_RULES, read the internal table I_KONV for I_KONV-KSCHL equal to I_ZBE_RULES-CR2, If the condition satisfied then keep the record otherwise delete the entry from I_KONV.

&#61656; Then Modify I_EKBE_TAB-KSCHL, I_EKBE_TAB-LIFNR, I_EKBE_TAB-KWERT with I_KONV-KSCHL, I_KONV-LIFNR, I_KONV-KWERT based on KNUMV of I_KONV.</b>

PLease sujjest if anything wrong in above!

Thanks & Regards,

Rayeez.

Read only

0 Likes
1,099

Hi,

Also after that process in next 2 process i need to perform following FD.

<b>Process 4 : Delete records from itab for all P.O’s for which no data from KONV was read.</b>

<b>Preocess 5 : Read EKBE-EBELN & EKBE-EBELP with itab-EBELN&EBELP Where the date & time stored from Process 1are less than EKBE – CPUDT - Accounting Document Entry Date, EKBE --CPUTM - Time of Entry and EKBE-MBLNR <> (NE) to ‘BLANK’

If records found, delete records from itab for all P.O’s where GR already posted to avoid duplicate postings. (partial GR might have received earlier and processed for Spl chg Invoice for full amount)</b>

Can anybody say what can be the <b>logic[TD]</b> for above process(s).

Thanks & Regards,

Rayeez.

Read only

Former Member
0 Likes
1,099

Hi,

loop at I_ZBE_RULES where LRNDT < I_EKBE_TAB-CPUDT and  LRNTM < I_EKBE_TAB-CPUTM.
"do all processing..
exit.
ENDLOOP.

Regards

vijay