06-30-2007 9:19 AM
Hi,
can any body can send the code for validating sales order and shipment,when we enter the sales order or shipment as input in the selection screen.
It is very urgent....................
Thanks in advance.
06-30-2007 9:23 AM
Sudarsan,
data: begin of itab occurs 0.
include structure tablename.
data:end of itab.
parameters:p_vbeln like vbak-vblen,
p_ship like vbak-fieldname.
select * from tablename into table itab where vbeln = p_vbeln and
fieldname = p_ship.
Note:- fieldname is the field for shipment,get it from the concerned table.
tablename is the table from which you are selecting the data.
K.Kiran.
Message was edited by:
Kiran K
06-30-2007 9:23 AM
Sudarsan,
data: begin of itab occurs 0.
include structure tablename.
data:end of itab.
parameters:p_vbeln like vbak-vblen,
p_ship like vbak-fieldname.
select * from tablename into table itab where vbeln = p_vbeln and
fieldname = p_ship.
Note:- fieldname is the field for shipment,get it from the concerned table.
tablename is the table from which you are selecting the data.
K.Kiran.
Message was edited by:
Kiran K
06-30-2007 9:28 AM
hi,
You need write the select statment in the AT SELECTION SCREEN event to chekc the fields which you declared in the Selection screen.
parameters: P_VBELN like VBAK-VBELN.
<b>AT SELECTION-SCREEN.</b>
Select single * from VBAK where VBELN eq P_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 with 'no sales order'
endif.
<b>Do the same way for Shipment also.</b>
<b>or</b>
you provide the logic for validate the user entered sales order number and shipment.
<b>AT SELECTION-SCREEN ON P_VBELN.</b>
Select single * from VBAK where VBELN eq P_VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 with 'no sales order'
endif.
<b>AT SELECTION-SCREEN ON <SHIPMENT>.</b>
Regards
Ashok
Message was edited by:
Ashok Reddy
06-30-2007 9:29 AM
HI,
SEE TO THIS CODE.
--
TABLES : VBAK,VBAP.
TYPE-POOLS : SLIS.
--
TYPES : BEGIN OF TY_VBAK,
VBELN TYPE VBELN_VA,
ERDAT TYPE ERDAT,
ERZET TYPE ERZET,
ERNAM TYPE ERNAM,
END OF TY_VBAK.
--
SELECT-OPTIONS : S_VBAK FOR VBAK-VBELN.
--
START-OF-SELECTION.
SELECT VBELN
ERDAT
ERZET
ERNAM
FROM VBAK
INTO TABLE IT_VBAK
WHERE VBELN IN S_VBAK.