05-27-2014 5:41 PM
Keep getting this error and cannot figure out how to fix it. any ideas?
Here is the code i have:
REPORT Z_SALESORDERMIKE.
TABLES: ZMIKESALEDORDER, VBAK.
DATA: w_VBELN like VBAK-VBELN, w_ERDAT like VBAK-ERDAT, w_ERNAM like VBAK-ERNAM.
DATA wa_ZMIKESALEDORDER type VBAK.
INSERT VBAK from wa_ZMIKESALEDORDER.
PARAMETERS: SALESDOC like w_VBELN,
DATECRTD like w_ERDAT,
CRTDBY like w_ERNAM.
top-of-page.
start-of-selection.
select VBELN ERDAT ERNAM from VBAK into ZMIKESALEDORDER.
endselect.
AT SELECTION-SCREEN ON SALESDOC.
IF SALESDOC = w_VBELN.
WRITE: w_VBELN, w_ERDAT, w_ERNAM.
ENDIF.
AT SELECTION-SCREEN ON DATECRTD.
IF DATECRTD = w_ERDAT.
WRITE: w_VBELN, w_ERDAT, w_ERNAM.
ENDIF.
AT SELECTION-SCREEN ON CRTDBY.
IF CRTDBY = w_ERNAM.
WRITE: w_VBELN, w_ERDAT, w_ERNAM.
ENDIF.
end-of-selection.
end-of-page.
05-27-2014 6:16 PM
Hi Mike,
Your Select query syntax need to be changed.
Type SELECT in the abap editor and select the Keyword and press F1 to get the syntax and useful information.
Check sap help documentation for more information.
Regards,
AyyamPerumal
05-27-2014 6:23 PM
05-27-2014 6:38 PM
Hi Mike,
Can you please elaborate on what you are trying to bring out from this report?
Since you are trying to write a single line as no loop is used for the data, use SELECT SINGLE statement like
SELECT SINGLE VBELN ERDAT ERNAM from VBAK
into (W_VBELN,W_ERDAT,W_ERNAM)
WHERE VBELN = SALESDOC AND ERDAT = DATECRTD AND ERNAM = CRTDBY.
But still i am not sure what your requirement is.
Regards,
AyyamPerumal
05-27-2014 6:24 PM
Hi Mike,
You have used select end select.
select VBELN ERDAT ERNAM from VBAK into ZMIKESALEDORDER.
endselect.
and no where clause, I am not understanding your requirements, your query trying to fetch all records.
and what is the fields from this table ZESALEDORDER(may be diff structure from VBAK)
Please post your clear requirement.
Regards,
Vadamalai A.