2008 Apr 16 7:22 AM
Hi Friends
I have to upload one file contains:
PERNR STATUS
Staus may be : In Planning,In Process,Submitted,Approved.
I should have to upload same Pernr with Statuses In Planning,In Procee,Submitted.
But once it has processed with Approved it has to throw error if i have tried again the same pernr to upload.
For ex:
1000 inplanning
1000 in process
1000 submitted
1000 approved.
1000 in planning
Here first 4 records have to be upload successfully and for 5th record it has to throw the error as it already processed with Approved status.
Please help me in logic.
Thanks & Regards,
Sree
2008 Apr 16 7:34 AM
Hi,
See the ex: for upload a file .
DATA FNAME(60) VALUE 'myfile'.
TYPES: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
TYPES ITAB TYPE LINE OCCURS 10.
DATA: LIN TYPE LINE,
TAB TYPE ITAB.
DO 5 TIMES.
LIN-COL1 = SY-INDEX.
LIN-COL2 = SY-INDEX ** 2.
APPEND LIN TO TAB.
ENDDO.
OPEN DATASET FNAME FOR OUTPUT.
LOOP AT TAB INTO LIN.
IF LIN-COL1 EQ 'Approved'
MESSAGE e000(xxxx) WITH 'This pernr already approved'.
ELSE.
TRANSFER LIN TO FNAME.
ENDIF.
ENDLOOP.
CLOSE DATASET FNAME.
Pls. reward if useful....
Hi Friends
I have to upload one file contains:
PERNR STATUS
Staus may be : In Planning,In Process,Submitted,Approved.
I should have to upload same Pernr with Statuses In Planning,In Procee,Submitted.
But once it has processed with Approved it has to throw error if i have tried again the same pernr to upload.
For ex:
1000 inplanning
1000 in process
1000 submitted
1000 approved.
1000 in planning
Here first 4 records have to be upload successfully and for 5th record it has to throw the error as it already processed with Approved status.
Please help me in logic.
Thanks & Regards,
Sree
2008 Apr 16 7:27 AM
before upload check in dbase table whether same PERNR status is approved is there or not?
if approved status is there then raise an error msg other wise u can continue uploading
2008 Apr 16 7:34 AM
Hi,
See the ex: for upload a file .
DATA FNAME(60) VALUE 'myfile'.
TYPES: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
TYPES ITAB TYPE LINE OCCURS 10.
DATA: LIN TYPE LINE,
TAB TYPE ITAB.
DO 5 TIMES.
LIN-COL1 = SY-INDEX.
LIN-COL2 = SY-INDEX ** 2.
APPEND LIN TO TAB.
ENDDO.
OPEN DATASET FNAME FOR OUTPUT.
LOOP AT TAB INTO LIN.
IF LIN-COL1 EQ 'Approved'
MESSAGE e000(xxxx) WITH 'This pernr already approved'.
ELSE.
TRANSFER LIN TO FNAME.
ENDIF.
ENDLOOP.
CLOSE DATASET FNAME.
Pls. reward if useful....
2009 Apr 21 9:54 AM