06-24-2010 4:22 PM
HI,
I am facing problem with read statement, please find below my code and provide the solution.
My Internal Tables.
TYPES: BEGIN OF TYP_BSAK,
BUKRS TYPE BSAK-BUKRS,
LIFNR TYPE BSAK-LIFNR,
AUGDT TYPE BSAK-AUGDT,
GJAHR TYPE BSAK-GJAHR,
BELNR TYPE BSAK-BELNR,
BUZEI TYPE BSAK-BUZEI,
BUDAT TYPE BSAK-BUDAT,
BLART TYPE BSAK-BLART,
DMBTR TYPE BSAK-DMBTR,
SGTXT TYPE BSAK-SGTXT,
AUGBL TYPE BSAK-AUGBL,
HKONT TYPE BSAK-HKONT,
END OF TYP_BSAK.
DATA : IT_BSAK TYPE STANDARD TABLE OF TYP_BSAK WITH HEADER LINE,
WA_BSAK TYPE TYP_BSAK.
READ STATEMENT :
LOOP AT IT_BSIS INTO WA_BSIS. -> I am getting data in wa_BSIs
READ TABLE IT_BSAK INTO WA_BSAK -> I am Getting record in IT_BSAK bu the same is not populated in WA_BSAK
WITH KEY BUKRS = S_BUKRS.
IF SY-SUBRC = 0.
WA_OUTPUT-SAPSYS = 'PROBE'.
WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
WA_OUTPUT-BELNR = WA_BSAK-BELNR.
WA_OUTPUT-SGTXT = WA_BSAK-SGTXT.
WA_OUTPUT-BUDAT = WA_BSAK-BUDAT.
WA_OUTPUT-AUGBL = WA_BSAK-AUGBL.
WA_OUTPUT-LIFNR = WA_LFA1-LIFNR.
WA_OUTPUT-NAME1 = WA_LFA1-NAME1.
WA_OUTPUT-STRAS = WA_LFA1-STRAS.
WA_OUTPUT-ORT01 = WA_LFA1-ORT01.
WA_OUTPUT-REGIO = WA_LFA1-REGIO.
WA_OUTPUT-PSTLZ = WA_LFA1-PSTLZ.
WA_OUTPUT-STCD2 = WA_LFA1-STCD2.
ENDIF.
APPEND WA_OUTPUT TO IT_OUTPUT.
ENDLOOP.
Thanks and Regards
VB
06-24-2010 4:29 PM
This is still a pretty basic question. Please press F1 on READ before posting here.
Rob
06-24-2010 4:29 PM
This is still a pretty basic question. Please press F1 on READ before posting here.
Rob
06-24-2010 4:30 PM
i hope that S_BUKRS is a select option.. which is of type SIGN|OPTION|LOW|HIGH..
so you statement
with key BUKRS = S_BUKRS is comparing like this '1000' = 'IEQ1000'. and these defnitely are not the same... right!!!
so what you need to do is pass a specfic BUKRS like S_BUKRS-LOW.
where BUKRS = S_BUKRS-LOW.
06-24-2010 4:37 PM
READ TABLE IT_BSAK INTO WA_BSAK -> I am Getting record in IT_BSAK bu the same is not populated in WA_BSAK
WITH KEY BUKRS = S_BUKRS-low.
And please be sure whether you will have more values in select options.
Else you will need to pass s_bukrs-HIGH as well,
Please de bug and read the H1 help.
Thanks!
06-25-2010 7:59 AM
Hi,
I hope You have use below code solved your problem.
LOOP AT IT_BSIS INTO WA_BSIS
READ TABLE IT_BSAK INTO WA_BSAK
WITH KEY BUKRS = WA_BSIS-BUKRS.
IF SY-SUBRC = 0.
WA_OUTPUT-SAPSYS = 'PROBE'.
WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
WA_OUTPUT-BELNR = WA_BSAK-BELNR.
WA_OUTPUT-SGTXT = WA_BSAK-SGTXT.
WA_OUTPUT-BUDAT = WA_BSAK-BUDAT.
WA_OUTPUT-AUGBL = WA_BSAK-AUGBL.
WA_OUTPUT-LIFNR = WA_LFA1-LIFNR.
WA_OUTPUT-NAME1 = WA_LFA1-NAME1.
WA_OUTPUT-STRAS = WA_LFA1-STRAS.
WA_OUTPUT-ORT01 = WA_LFA1-ORT01.
WA_OUTPUT-REGIO = WA_LFA1-REGIO.
WA_OUTPUT-PSTLZ = WA_LFA1-PSTLZ.
WA_OUTPUT-STCD2 = WA_LFA1-STCD2.
ENDIF.
APPEND WA_OUTPUT TO IT_OUTPUT.
ENDLOOP.
Thanks
Regards
I.Muthukumar.
Edited by: I.Muthukumar on Jun 25, 2010 12:43 PM
06-25-2010 11:39 AM
Hi,
I think you wanted to refer the bukrs value present in wa_bsis instead of s_bukrs, if it is the case refer the following logic.
LOOP AT IT_BSIS INTO WA_BSIS. -> I am getting data in wa_BSIs
READ TABLE IT_BSAK INTO WA_BSAK -> I am Getting record in IT_BSAK bu the same is not populated in WA_BSAK
WITH KEY BUKRS = wa_BSIs-bukrs.
IF SY-SUBRC = 0.
WA_OUTPUT-SAPSYS = 'PROBE'.
WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
WA_OUTPUT-BUKRS = WA_BSAK-BUKRS.
WA_OUTPUT-BELNR = WA_BSAK-BELNR.
WA_OUTPUT-SGTXT = WA_BSAK-SGTXT.
WA_OUTPUT-BUDAT = WA_BSAK-BUDAT.
WA_OUTPUT-AUGBL = WA_BSAK-AUGBL.
WA_OUTPUT-LIFNR = WA_LFA1-LIFNR.
WA_OUTPUT-NAME1 = WA_LFA1-NAME1.
WA_OUTPUT-STRAS = WA_LFA1-STRAS.
WA_OUTPUT-ORT01 = WA_LFA1-ORT01.
WA_OUTPUT-REGIO = WA_LFA1-REGIO.
WA_OUTPUT-PSTLZ = WA_LFA1-PSTLZ.
WA_OUTPUT-STCD2 = WA_LFA1-STCD2.
ENDIF.
APPEND WA_OUTPUT TO IT_OUTPUT.
ENDLOOP.
Regards,
Preetham
06-25-2010 12:14 PM
Hi,
You can follow the following steps always,
sort it_bsak. /* this should be on required fields to be easy for searching
loop at it_bsis into wa_bsis.
clear wa_bsak
read table it_bsak into wa_bsak with key bukrs = wa_bsis-bukrs binary search.
if sy-subrc eq 0.
/* write your append statements when seach is successful.
endif.
clear wa_bsis.
endloop.
I am not sure why are you using s_bukrs. If you clarify the requirement more, I will be able to guide you better.
06-25-2010 2:39 PM
06-25-2010 2:54 PM
> read (v.) to translate written text into meaningful ideas within one's own mind. People usually read to gain knowledge or to awaken their imagination. Sadly, the act of reading seems to have been "bred out" of the human race. People these days would much rather desensetize themselves with stupid rap noise and violent, pornographic, and otherwise unintelligent forms of media. If you are an ABAP developer and find it hard to read, do yourself a favor and get help. No offense! Reading is a great and powerful thing, and only by fully taking advantage of it can one open his or her mind to the possibilities of his or her own future.
"urban dictionary" with one adjustment