Skip to Content
0
Nov 23, 2012 at 11:52 PM

RE :Issue in syntax errors in ABAP

37 Views

Hello Gurus,

I am new to ABAP coding I was working on the code for doing a look up from the tables in CO- PA my requirement was to do a look up for

VBRP- VBELN = COPA WEBEL (Bbilling document )

VBRP-AUBEL = COPA RRKAUFNR sales document

VBRP -AUPOS = COPA KDPOS (sales document item )

AND

VBRP - CHARG is NOT EQUAL to speces ( CHARG = batch number )

to retreive the batch number we are doing the look up between this two tables.

code already existing in the user exit :

REPORT ZBW1_CO_PA_AAFI1 .
************************************************************************
* Form called dynamically must start with FORM_ + <DataSource> *
************************************************************************

FORM FORM_1_CO_PA_AAFI1 TABLES I_T_DATA.

FIELD-SYMBOLS: <FS> LIKE ZOXDEV0201.

Data: l_msgv TYPE symsgv,
l_subrc LIKE sy-subrc.

LOOP AT I_T_DATA ASSIGNING <FS>.

* Call to line item table to get Point of Valuation for COS Revaluation
* recon. Make call only for actual (not plan) data.

IF <FS>-wrttp = '10'.
SELECT SINGLE copa_bwzpt frwae
INTO (<FS>-zzbwzpt, <FS>-zzfrwae)
FROM ce1ashi
WHERE belnr = <FS>-belnr.

CASE sy-subrc.
when 0.
when others.
clear:<FS>-zzbwzpt,
<FS>-zzfrwae.
l_subrc = sy-subrc.
l_msgv = <FS>-belnr.
MESSAGE ID 'ZBW' TYPE 'X' NUMBER '000'
WITH 'BELNR' l_msgv l_subrc.
ENDCASE.
ENDIF.

ENDLOOP. "I_T_DATA.

endform.

FORM FORM_1_CO_PA_AAFI1 TABLES I_T_DATA.

The code I wanted to introudce for look up

DATA : I_T_DATA TYPE STANDARD TABLE OF Y_VBRP

IF <FS> = I_T_DATA

SELECT VBELN

AUBEL

AUPOS

FROM VBRP INTO I_T_DATA FOR ALL ENTRIES

where

VBRP- VBELN = <FS>- WWBEL

VBRP- AUBEL = <FS>-RKAUFNR

VBRP- AUPOS = <FS>-KDPOS

VBRP-CHARG IS NOT EQUAL TO 'SPACE'

SORT I_T_VBRP BY VBELN

ENDIF.

It was throwing syntax errors when I have introudced this code to the existing exit. I request you to let me know if there are syntax and logical errors in the above statements and guide me in correcting this.

Thanks

I