on 05-06-2009 10:41 AM
hello,
i have a question..
how can i read a single data from a SOURCE_PACKAGE.
SELECT SINGLE *
FROM SOURCE_PACKAGE
INTO ls_before_image
WHERE vbeln EQ <source_fields>-vbeln
AND posnr EQ <source_fields>-posnr
IF sy-subrc = 0.
...
But it dont work... how can i do that??? and how can i delete a single data from SOURCE_PACKAGE with keys.
Actually i do it like
LOOP AT SOURCE_PACKAGE INTO ls_before_image
WHERE vbeln EQ <source_fields>-vbeln
AND posnr EQ <source_fields>-posnr
ENDLOOP.
IF sy-subrc = 0.
...
Is this the only way to do that?
regards sunny
Edited by: sunnyfriday on May 6, 2009 11:43 AM
hey sunny second one is the standrad way...
like this..
LOOP AT SOURCE_PACKAGE INTO <FS>
assign <fs> to source_package.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
i do it like that. Is that ok?
LOOP AT SOURCE_PACKAGE INTO ls_before_image
WHERE vbeln EQ <source_fields>-vbeln
AND posnr EQ <source_fields>-posnr
If sy-subrc = 0
* operate with ls_before_image
delete source_package where vbeln = <source_fields>-vbeln and posnr = <source_fields>-posnr.
exit.
endif
ENDLOOP.
LOOP AT SOURCE_PACKAGE INTO <source_fields>-
WHERE vbeln EQ <source_fields>-vbeln
AND posnr EQ <source_fields>-posnr
If sy-subrc = 0
* operate with ls_before_image
delete source_package where vbeln = <source_fields>-vbeln and posnr = <source_fields>-posnr.
exit.
endif
assign <source_fields> to source_package.
ENDLOOP.
use this
LOOP AT SOURCE_PACKAGE INTO ls_before_image
WHERE vbeln EQ <source_fields>-vbeln
AND posnr EQ <source_fields>-posnr
If sy-subrc = 0
operate with ls_before_image
delete source_package.
where vbeln = <source_fields>-vbeln and posnr = <source_fields>-posnr. ( no need to chk this again)
exit.
endif
ENDLOOP.
You want to delete all the records in source_package which meet the conditions??
Then dont use exit in the loop.
Because then it will delete the first record and exit from the loop.
Regards,
Mansi
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.