2013 Feb 25 10:32 AM
Hi,
READ TABLE
it_vbrp_arch INTO wa_vbrp_arch WITH KEY vbeln = ibil_doc_data-docno
posnr = ibil_doc_data-posnr.
in above stmt i am reading data into table it_vbrp_arch with key values.my doubt is ,is vbeln in key points to it_vbrp_arch-vbeln or vbrp-vbeln
Moderator Message: Read the F1 help or the online SAP documentation before posting your question.
Message was edited by: Suhas Saha
Hi,
READ TABLE
it_vbrp_arch INTO wa_vbrp_arch WITH KEY vbeln = ibil_doc_data-docno
posnr = ibil_doc_data-posnr.
in above stmt i am reading data into table it_vbrp_arch with key values.my doubt is ,is vbeln in key points to it_vbrp_arch-vbeln or vbrp-vbeln
Moderator Message: Read the F1 help or the online SAP documentation before posting your question.
Message was edited by: Suhas Saha
2013 Feb 25 10:39 AM
Hi Krishna,
You are reading values FROM table it_vbrp_arch into the work area wa_vbrp_arch and the Key vbeln refers to the vbeln of the table it_vbrp_arch.
Another point I would like to add is, in order to improve read performance on this table, you can first sort table it_vbrp_arch and then read binary search while reading as below:
SORT it_vbrp_arch by vbeln posnr. (This statement sorts it by vbeln first and then posnr within the vbelns in ascending order as default. This sort should be kept outside the loop).
READ TABLE it_vbrp_arch INTO wa_vbrp_arch WITH KEY vbeln = ibil_doc_data-docno
posnr = ibil_doc_data-posnr
BINARY SEARCH.
You can read some online documents for such queries.
2013 Feb 25 10:43 AM
Hi,
It can be it_vbrp_arc-vbeln as compared to the other value. Its always good to use it or wa. If it doesn't work, can you please send the elaborated code?
Regards
Purnand
2013 Feb 25 10:53 AM
krishna sree wrote:
Hi,
READ TABLE
it_vbrp_arch INTO wa_vbrp_arch WITH KEY vbeln = ibil_doc_data-docno
posnr = ibil_doc_data-posnr.
in above stmt i am reading data into table it_vbrp_arch with key values.my doubt is ,is vbeln in key points to it_vbrp_arch-vbeln or vbrp-vbeln
I hope it_vbrp_arch is standard table of VBRP.So it_vbrp_arch-vbeln refers to it_vbrp_arch(i.e VRBP-VBELN).
Thanks
Katrice
2013 Feb 25 11:05 AM
Hi Krishna,
you can refer to it_vbrp_arch-vbeln instead of directly referring it as vbeln..
and also sort the internal table before you read and delete adjacent duplicates.
after read statement use sy-subrc check statement..
for ex..
SORT it2 BY lifnr.
DELETE ADJACENT DUPLICATES FROM it2 COMPARING lifnr.
LOOP AT it1 INTO wa1.
READ TABLE it2 INTO wa2 WITH KEY wa1-lifnr BINARY SEARCH.
IF sy-subrc IS INITIAL.
MESSAGE 'There is PO for this Vendor' TYPE 'I'.
ELSE.
MOVE wa1 TO wa.
APPEND wa TO it.
this is sample code..
2013 Feb 25 11:10 AM
hi, when i am trying to refer using it_vbrp_arch-vbeln,it s throwing an error like no component exits with the name it_vbrp_arch-vbeln.,nw my doubt is cleared by ur replies ,thank q all
2013 Feb 25 11:15 AM
Hi Krishna,
if you want to refer that field means that field should present in the structure for the internal table..
otherwise it will throw u error as unknown component..
Thanks
Pavan.
2013 Feb 25 11:16 AM
if it1 and it2 r same ,can we write the read stmt without loop to read the table itab in to wa.
2013 Feb 25 11:22 AM
Hello Krishna,
You can also use field symbol.
For example:
DATA : lt_vbrp TYPE STANDARD TABLE OF vbrp.
FIELD-SYMBOLS <fs_vbrp> TYPE any .
SELECT * FROM vbrp INTO TABLE lt_vbrp.
SORT lt_vbrp BY vbeln .
DELETE ADJACENT DUPLICATES FROM lt_vbrp COMPARING ALL FIELDS.
READ TABLE lt_vbrp INTO <fs_vbrp> WITH KEY vbeln = ___.
If <fs_vbrp> is assigned.
__________________
endif.
Katrice
2013 Feb 25 11:23 AM
Hi Krishna,
If there is more than 1 record, you have to use loop.
Regards
Purnand
2013 Feb 25 11:26 AM
Hi Krishna,
One suggestion from my side, try to use wa instead of it. Its more efficient.
Regards
Purnand
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |