‎2007 Jun 29 4:25 AM
Hi friends,
I want to keep two if conditions.,
1. IF ( zinv_mov-status = 'DI' and zinv_mov-xblnr is initial ).
2. IF not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
Can you tell me what is wrong in the statement.
Regards,
Line
‎2007 Jun 29 4:31 AM
i am not sure what is your requirement but if you are using like this
IF ( zinv_mov-status = 'DI' and zinv_mov-xblnr is initial ).
IF not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
endif.
endif.
then two ifs are contradictory because in first if you are checking zinv_mov-xblnr must be initial and in the 2nd if you are checking zinv_mov-xblnr must not be initial.
i think you want to do like that..
IF ( zinv_mov-status = 'DI' and zinv_mov-xblnr is initial ).
elseif not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
endif.
correct me if i am wrong and what is your exact requirement...
regards
shiba dutta
‎2007 Jun 29 4:29 AM
Try to keep the 2 if statement first and first if statement later.
IF not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
IF not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
***********
**************
************
ENDIF.
ENDIF.
Reward points if useful.
Regards,
SaiRam
‎2007 Jun 29 4:31 AM
Hi
Can you please tell what exactly do you want,after writting the statements as the objective of writing the statement is not clear nothing can be suggested.
Thanks
‎2007 Jun 29 4:31 AM
i am not sure what is your requirement but if you are using like this
IF ( zinv_mov-status = 'DI' and zinv_mov-xblnr is initial ).
IF not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
endif.
endif.
then two ifs are contradictory because in first if you are checking zinv_mov-xblnr must be initial and in the 2nd if you are checking zinv_mov-xblnr must not be initial.
i think you want to do like that..
IF ( zinv_mov-status = 'DI' and zinv_mov-xblnr is initial ).
elseif not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
endif.
correct me if i am wrong and what is your exact requirement...
regards
shiba dutta
‎2007 Jun 29 4:33 AM
Hi Line,
What exactly is your requirement.
Just by looking at your IF I can say you should change
2. IF not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
To
<b>IF zinv_mov-status is NOT initial AND
zinv_mov-xblnr is NOT initial</b>.
Regards,
Atish
‎2007 Jun 29 4:39 AM
Sorry Friends,
I need to select the data on two requirement.,
1. When the user uses the status in the screen
Or
2. When the user uses the status with the invoice number.
Based on this two conditions I need to pick the data from the database table.
Regards,
Line
‎2007 Jun 29 4:41 AM
Hi,
do it like this.
IF ( zinv_mov-status = 'DI' and zinv_mov-xblnr is initial ) or not ( zinv_mov-status is initial
and zinv_mov-xblnr is initial ).
endif.
<b>reward if helpful.</b>
rgds,
bharat.
‎2007 Jun 29 4:42 AM
Hi Line,
Just paste your code then, I can suggest the required changes.
Regards,
Atish
‎2007 Jun 29 5:05 AM
Hi there,
Here is my code
*IF zinv_mov-status EQ 'DI' and zinv_mov-xblnr is not initial.
SELECT trans
lifnr
xblnr
bukrs
procese
appdate
usnam
status
FROM zinv_mov INTO CORRESPONDING FIELDS OF
TABLE lt_invmov WHERE clear NE 'CL'
AND status NE 'PV'
OR xblnr EQ zinv_mov-xblnr.
PERFORM vendorname.
SORT lt_invmov BY xblnr.
IF sy-subrc <> 0.
MESSAGE i000(x) WITH 'No Records for processing'.
ENDIF.
ENDIF.
IF zinv_mov-status = 'DI'.
SELECT trans
lifnr
xblnr
bukrs
procese
appdate
usnam
status
FROM zinv_mov INTO CORRESPONDING FIELDS OF
TABLE lt_invmov WHERE clear NE 'CL'
AND status NE 'PV'
AND xblnr EQ zinv_mov-xblnr.
IF sy-subrc <> 0.
MESSAGE i000(x) WITH 'No Records for processing'.
ENDIF.
ENDIF.
Regards,
Line
‎2007 Jun 29 5:18 AM
Hi Line,
Just change your code as below.
IF zinv_mov-status EQ 'DI' OR inv_mov-xblnr is not initial.
SELECT trans
lifnr
xblnr
bukrs
procese
appdate
usnam
status
FROM zinv_mov INTO CORRESPONDING FIELDS OF
TABLE lt_invmov WHERE clear NE 'CL'
AND status NE 'PV'.
if inv_mov-xblnr is not initial.
DELETE lt_invmov where xblnr NE inv_mov-xblnr.
ENDIF.
PERFORM vendorname.
SORT lt_invmov BY xblnr.
IF sy-subrc <> 0.
MESSAGE i000(x) WITH 'No Records for processing'.
ENDIF.
ENDIF.
Reward points if useful.
Regards,
Atish
‎2007 Jun 29 5:00 AM
make your status field mandatory so that user must enter one value there.
if zinv_mov-xblnr is initial.
select .... where status = zinv_mov-status.
"or you can specify DI in where as per ur requirement
else.
select .... where status = zinv_mov-status and xblnr = zinv_mov-xblnr .
endif.
regards
shiba dutta
‎2007 Jun 29 5:49 AM
Hi
you can try this ...
IF ZINV_MOV-STATUS EQ 'DI'.
IF ZINV_MOV-XBLNR IS NOT INITIAL.
SELECT TRANS
LIFNR
XBLNR
BUKRS
PROCESE
APPDATE
USNAM
STATUS
FROM ZINV_MOV INTO CORRESPONDING FIELDS OF
TABLE LT_INVMOV WHERE CLEAR NE 'CL'
AND STATUS NE 'PV'
OR XBLNR EQ ZINV_MOV-XBLNR.
PERFORM VENDORNAME.
SORT LT_INVMOV BY XBLNR.
IF SY-SUBRC <> 0.
MESSAGE I000(X) WITH 'No Records for processing'.
ENDIF.
ELSEIF ZINV_MOV-XBLNR IS INITIAL.
SELECT TRANS
LIFNR
XBLNR
BUKRS
PROCESE
APPDATE
USNAM
STATUS
FROM ZINV_MOV INTO CORRESPONDING FIELDS OF
TABLE LT_INVMOV WHERE CLEAR NE 'CL'
AND STATUS NE 'PV'
AND XBLNR EQ ZINV_MOV-XBLNR.
IF SY-SUBRC <> 0.
MESSAGE I000(X) WITH 'No Records for processing'.
ENDIF.
ENDIF.
ENDIF.
Rewards if useful.
Regards