Hi Naveen,
Lots of issues in this code -
IF it_vbap[] IS NOT INITIAL.
* SELECT datuv
* atinn
* FROM ausp
* INTO TABLE it_ausp FOR ALL ENTRIES IN git_output
* WHERE objek = git_output-matnr
* LOOP AT it_ausp INTO gwa_ausp.
* DATA: lv_atinn TYPE string.
* CALL FUNCTION 'CONVERSION_EXIT_ATINN_OUTPUT'
* EXPORTING
* input = gwa_ausp-atinn
* IMPORTING
* output = lv_atinn.
*
* CONCATENATE gwa_ausp-atinn lv_atinn INTO gwa_ausp-atinn SEPARATED BY ','.
*
* APPEND gwa_ausp TO it_ausp.
* ENDLOOP.
* ENDIF.
They are -
1) It will not be syntactically correct unless git_output-matnr is declared of type ausp-objek, which i highly doubt. The reason for this is whenever using FAE SAP compiler matches the data type of both the used fields which should be same. Here it is different (One is Matnr and other is Objek).
Solution :- Make another table and loop on git_output and type cast the values as,
types : begin of ty_temp,
............................
.........................
objek type ausp-objek,
....................
end of ty_temp.
data : lt_temp type standard table of ty_temp,
ls_temp type ty_temp.
loop at git_output into <work area of git_output>.
*-- Transfer other fields if you need
ls_temp-objek = <work area of git_output>-matnr.
append ls_temp to lt_temp.
*-- clear all work areas.
endloop.
Now use lt_temp in FAE.
2) Instead of checking it_vbap you should check git_output(previously) but lt_temp (now , which is correct) for Initial condition.
3) Do not declare lv_atinn every time in loop pass. Instead declare outside and clear in loop the value as,
DATA: lv_atinn TYPE string.
LOOP AT it_ausp INTO gwa_ausp.
................
clear lv_atinn.
ENDLOOP
4) It is an endless loop since you are looping and appending in the same internal table.
Ask if anything is unclear.
BR.