Posted: Wed Jul 15, 2009 6:53 am Post subject: Parameters and Select-options
Hi i realize that when i use parameters, i was able to update to my database but when i use select-options, i wasn't...
anyone has any idea why and how can i change my codes to suit the select-options(because i need to select a range to update)?Thanks
Code:
DATA:it_bseg TYPE bseg OCCURS 0 WITH HEADER LINE,
it_ekpo TYPE ekpo OCCURS 0 WITH HEADER LINE,
it_combo TYPE TABLE OF t_combo WITH HEADER LINE.
PARAMETERS:p_belnr LIKE bseg-belnr OBLIGATORY,
p_bukrs LIKE bseg-bukrs OBLIGATORY,
p_gjahr LIKE bseg-gjahr OBLIGATORY,
p_ebeln LIKE ekpo-ebeln,
p_ebelp LIKE ekpo-ebelp,
p_budat LIKE bkpf-budat.
*SELECT-OPTIONS: p_belnr FOR bseg-belnr OBLIGATORY,
* p_bukrs FOR bseg-bukrs OBLIGATORY,
* p_gjahr FOR bseg-gjahr OBLIGATORY,
* p_ebeln FOR ekpo-ebeln,
* p_ebelp FOR ekpo-ebelp.
** p_budat FOR bkpf-budat.
*** p_hkont FOR bseg-hkont.
START-OF-SELECTION.
SELECT * FROM ekpo INTO TABLE it_ekpo
WHERE ebeln = p_ebeln AND ebelp = p_ebelp.
SELECT * FROM bseg INTO TABLE it_bseg
WHERE belnr = p_belnr AND bukrs = p_bukrs AND gjahr = p_gjahr.
*AND hkont = p_hkont.
IF it_bseg[] IS NOT INITIAL.
SELECT SINGLE TXZ01 INTO EKPO-TXZ01
FROM EKPO WHERE
EBELN = BSEG-EBELN AND
EBELP = BSEG-EBELP.
IF SY-SUBRC EQ 0.
BSEG-SGTXT = EKPO-TXZ01.
ENDIF.
LOOP AT IT_EKPO.
MOVE it_ekpo-txz01 TO it_bseg-sgtxt.
MODIFY it_bseg FROM it_bseg TRANSPORTING sgtxt
WHERE belnr = p_belnr AND bukrs = p_bukrs AND gjahr = p_gjahr.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.