Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

help needed

Former Member
0 Kudos

Hi experts,

this is my code during running it display problem like "field ENDIF is unknown it is neither in one of the specified tables nor defined by a DATA statement.

PLEASE GUIDE ME.

----


  • Form process_data

----


  • Processing output data

----


form process_data .

  • Get AUFSD value from ZVARV

perform zvarv_read.

loop at i_knb1.

read table i_kna1 with key kunnr = i_knb1-kunnr.

if sy-subrc ne 0.

concatenate: 'in kna1 no record found for Customer number'

i_knb1-kunnr

into v_result separated by space.

move v_result to i_error_log-message.

append i_error_log.

clear i_error_log.

v_count = v_count + 1.

else.

  • Move the kna1 data to output

move : i_kna1-name1 to i_output-custname,

i_kna1-stras to i_output-custaddress,

i_kna1-ort01 to i_output-custcity,

i_kna1-stcd1 to i_output-taxid,

i_kna1-pstlz to i_output-postalcode,

endif.

read table i_knvp with key kunnr eq i_knb1-kunnr.

if sy-subrc ne 0.

concatenate : 'in knvp no record found for customer number'

v_knb1-kunnr

into v_result1 separated by space.

move v_result1 to v_error_log-message.

append v_error_log to i_error_log.

v_count1 = v_count1 + 1.

else.

loop at i_knvp where kunnr eq knb1-kunnr.

  • Move the knvp data to output

move : i_knvp-kunnr to i_output-soldtocust,

i_knvp-kunn2 to i_output-payer,

end loop.

endif.

v_sequence = v_sequence + 1.

  • Move non table related data to output

move : 'C' to i_output-recordtype,

v_sequence to i_output-sequence,

'1' to i_output-branch,

'ABC' to i_output-delivery.

append i_output.

  • insert v_output into table i_output.

*

  • clear : v_knb1,

  • v_kna1,

  • v_knvp,

  • v_output.

clear : i_output.

endloop.

endform. " process_data

Thanks,

venkat

1 ACCEPTED SOLUTION

suresh_datti
Active Contributor
0 Kudos

make this change ie replace the comma with a period.

i_kna1-pstlz to i_output-postalcode.

endif.

~Suresh

4 REPLIES 4

suresh_datti
Active Contributor
0 Kudos

make this change ie replace the comma with a period.

i_kna1-pstlz to i_output-postalcode.

endif.

~Suresh

Former Member
0 Kudos

can u send me the entire code

Thanks

Vikranth Khimavath

ferry_lianto
Active Contributor
0 Kudos

Hi Venkat,

Please replace your old codes with the following codes (in bold).

...

  • Move the kna1 data to output

move : i_kna1-name1 to i_output-custname,

i_kna1-stras to i_output-custaddress,

i_kna1-ort01 to i_output-custcity,

i_kna1-stcd1 to i_output-taxid,

<b>i_kna1-pstlz to i_output-postalcode.</b>

endif.

...

loop at i_knvp where kunnr eq knb1-kunnr.

  • Move the knvp data to output

move : i_knvp-kunnr to i_output-soldtocust,

<b>i_knvp-kunn2 to i_output-payer.</b>

<b>endloop.</b>

endif.

...

Regards,

Ferry Lianto

Former Member
0 Kudos

Hi Venkat,

Please replace the comma with a full stop after

i_kna1-pstlz to i_output-postalcode

Hope this helps!

Regards,

Saurabh