‎2009 Jul 16 6:51 AM
hi friends
i have a doubt in read statement
please suggest me which one i can use.
i have one master table
with fields like
contract contract line wbs
500060 10 XXX
500070 10 XXX
and the transaction table has
500060 10 01 01 01
500060 10 02 02 02
500070 10 01 01 01
500070 10 02 02 02what i am doing is like
loop at master table into wamastertable
read table tranintertab into tranintertab1 with key contract=wamastertable-contract
contractline = wamastertable-contractline.
endloop.As my read query satifies multiple lines of transaction internal table i am in a posistion to do this
but if i do like the above it is giving error that tranintertab1 is not the line type of tranintertab
please provide me ur valuable suggestions.
‎2009 Jul 16 6:56 AM
Is there any need of using into traininternaltab1 in READ statement.
You can use without this also.
I think the proble is in declaration of this traininternaltab1.
Regds,
Anil
‎2009 Jul 16 6:54 AM
Hi,
Check the declaration of tranintertab1 in the Read statement. Tranintertab1 shjould be declared as workarea with the same structure of tranintertab.
‎2009 Jul 16 6:58 AM
hi avinash thanks for answering
but my doubt is
not exactly this
i need to transfer the contents of the that tranintertab into another intertab of same structure because it has mulitple lines satisfying the key of mastertab
so do i need to use read statement or someother
cheers
s.janagar
‎2009 Jul 16 6:56 AM
Is there any need of using into traininternaltab1 in READ statement.
You can use without this also.
I think the proble is in declaration of this traininternaltab1.
Regds,
Anil
‎2009 Jul 16 7:00 AM
yes anil
i need to count the entries statisfying that condition.
based upon the no. of lines satisfying that condition.
i need to do some manipulation
with regards
s.janagar
‎2009 Jul 16 7:11 AM
Hi,
Loop at master into wamastertable.
Clear count.
Loop at transaction where contract=wamastertable-contract and contractline = wamastertable-contractline.
Count = count + 1.
endloop.
" you get the count which satisfies the given condition
Endloop.
‎2009 Jul 16 7:12 AM
Hi,
See if this helps.
" t_tran and t_final structures are the same
LOOP AT t_master INTO wa_master.
LOOP AT t_tran INTO wa_tran.
IF wa_tran-vbeln EQ master-vbeln.
MOVE-CORRESPONDING wa_tran TO wa_final.
APPEND wa_final TO t_final.
CLEAR wa_final.
CLEAR wa_tran.
ENDIF.
ENDLOOP.
CLEAR wa_master.
ENDLOOP.
" Describe statement to count the number of records in t_final
" that is those that have satisfied your condition
Edited by: Nitwick on Jul 16, 2009 11:43 AM
‎2009 Jul 16 7:13 AM
Hi Janagar,
If you wish to read all lines in the transaction table satisfying the criteria, then you shoudl loop at transaction type instead of master table.
loop at tranintertab into tranintertab1.
read table master table into wamastertable with key
contract = tranintertab1-contract
contractline = tranintertab1-contractline.
endloop.Also check the declaration of tranintertab1. It should be of the same structure as tranintertab.
Regards,
Saumya
‎2009 Jul 16 6:57 AM
>
>
contract contract line wbs > 500060 10 XXX > 500070 10 XXX > and the transaction table has > 500060 10 01 01 01 > 500060 10 02 02 02 > 500070 10 01 01 01 > 500070 10 02 02 02>
>
loop at master table into wamastertable > read table tranintertab into tranintertab1 with key contract=wamastertable-contract > contractline = wamastertable-contractline. > endloop.>
Try it like this..........
loop at tranintertab into tranintertab1.
read table master table into wamastertable with key
contract = tranintertab1-contract
contractline = tranintertab1-contractline.
endloop.Regards,
Suneel G
‎2009 Jul 16 6:57 AM
Check the declaration tranintertab1 , this should be same structure as that of the tranintertab.
‎2009 Jul 16 6:57 AM
Hi
Read Statement : reads a line from the internal table into work area of the internal
Even the condiction satisfy many lines , it reads only one line line that to first satisfied line.
So,
If you want all records to be displayed ,
Run a loop at transaction Table ,
Read a master table which will have one master record.
try and reply
‎2009 Jul 16 6:58 AM
Hi,
use loop into loop because you have multiple entries in transaction table .
and read statement can read only one record at a time.
use like this..
Loop at master into wamastertable.
Loop at transaction where contract=wamastertable-contract and contractline = wamastertable-contractline.
endloop.
-
-
endloop.
Endloop.
Regards,
Vijay