2008 May 14 11:38 AM
hi ,
i want to give validation for two input files.as if i load any file between these two it should load it .But if i load the file other than this than it must give error as not a valid load file.
I am trying to do it with this code but it is getting done.
pls help me out.
IF ( P_FILE CP 'Balances_DMTHMPLAN' ) OR
( P_FILECP 'Balances_VMTHMPLAN' ).
IF SY-SUBRC <> 0.
MESSAGE E000 WITH TEXT-013 . ENDIF.
ENDIF.
hi ,
i want to give validation for two input files.as if i load any file between these two it should load it .But if i load the file other than this than it must give error as not a valid load file.
I am trying to do it with this code but it is getting done.
pls help me out.
IF ( P_FILE CP 'Balances_DMTHMPLAN' ) OR
( P_FILECP 'Balances_VMTHMPLAN' ).
IF SY-SUBRC <> 0.
MESSAGE E000 WITH TEXT-013 . ENDIF.
ENDIF.
2008 May 14 11:45 AM
You have 2 options.
IF ( P_FILE CS 'Balances_DMTHMPLAN' )
OR ( P_FILE CS 'Balances_VMTHMPLAN' ).
*>>> Do Something
ELSE.
MESSAGE E000 WITH TEXT-013 .
ENDIF.
SEARCH P_FILE for 'Balances_DMTHMPLAN'.
if sy-subrc NE 0.
SEARCH P_FILECP for 'Balances_VMTHMPLAN'.
if sy-subrc NE 0.
MESSAGE E000 WITH TEXT-013 .
else.
* Do something
endif.
else.
* Do something
endif.
Edited by: Paul Chapman on May 14, 2008 6:47 AM
2008 May 14 11:49 AM
i think you are checking the reverse condition....you should throw the error if the if statement fails....and i feel there is no need to check sy-subrc after if statement
IF ( p_file CP 'Balances_DMTHMPLAN' ) OR
( p_file CP 'Balances_VMTHMPLAN' ).
*<do your processing here>
else.
MESSAGE e000 WITH text-013 .
ENDIF.
2008 May 14 11:52 AM
IF ( P_FILE CP 'Balances_DMTHMPLAN' ) OR
( P_FILECP 'Balances_VMTHMPLAN' ).
IF SY-SUBRC 0. "NO NEED FOR THIS.
MESSAGE E000 WITH TEXT-013 . ENDIF.
ENDIF.
What does your p_file look like because the expression looks ok, but remember case sensitive!!!
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |