SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Parameters and Select-options



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
weelilin
Участник
Участник



Joined: 13 Jul 2009
Posts: 10

PostPosted: Wed Jul 15, 2009 6:53 am    Post subject: Parameters and Select-options Reply with quote

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.

    WRITE:/ it_bseg-belnr, it_bseg-gjahr, it_bseg-sgtxt, it_ekpo-ebeln.
  ENDLOOP.


  MODIFY bseg FROM TABLE it_bseg.
  COMMIT WORK.

ENDIF.
  IF sy-subrc EQ 0.
    WRITE:/3 'BSEG TABLE UPDATED SUCCESSFULLY WITH TEXT'.
  ENDIF.
Back to top
View user's profile Send private message
vga
Мастер
Мастер


Age: 170
Joined: 04 Oct 2007
Posts: 1218
Location: Санкт-Петербург

PostPosted: Wed Jul 15, 2009 6:48 pm    Post subject: Reply with quote

Hi! Please provide us not working code.
Back to top
View user's profile Send private message Blog Visit poster's website
weelilin
Участник
Участник



Joined: 13 Jul 2009
Posts: 10

PostPosted: Thu Jul 16, 2009 4:26 am    Post subject: Reply with quote

hi my codes are ok already..i figure out that i shuld use IN instead of AND.Thankssss Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.