Skip to Content
0
Former Member
Sep 23, 2014 at 08:30 AM

check if variables are initial or not in abap

3223 Views

I need to fetch records from csv file and process it.Initially i need to check if all the values are there or not(around 15 fields),if the value is initial(i.e blank) i need to throw the error(output has to be written in a file for each record).

Current logic i am following is :

LOOP AT gt_filedata into gs_filedata.

IF gs_filedata-var1 IS INITIAL.

concatenate gv_msg text-001 into gv_msg SEPARATED BY ','.

ENDIF.

IF gs_filedata-var2 IS INITIAL.

concatenate gv_msg text-002 into gv_msg SEPARATED BY ','.

ENDIF.

And So on...

ENDLOOP.

I need to know if there any function module or any other way to optimize my code and improve its performance.