You are on page 1of 4

Copiar e colar o código fonte abaixo:

FUNCTION Z_RFC_GET_VENDOR.
*"--------------------------------------------------------------------
--
*"*"Interface local:
*" IMPORTING
*" VALUE(LIFNR) LIKE LFA1-LIFNR
*" VALUE(LAND1) LIKE LFA1-LAND1
*" TABLES
*" T_LFA1 STRUCTURE LFA1
*" EXCEPTIONS
*" ERROR
*" NO_DATA
*"--------------------------------------------------------------------
--
*{ INSERT M01K900263
1
*{ DELETE M01K900263
1
*\check not lifnr is initial.
*\
*\ condense lifnr no-gaps.
*\ shift lifnr right deleting trailing space.
*\ translate lifnr using ' 0'.
*\
*\ clear lfa1.
*} DELETE
*{ DELETE M01K900263
2
*\ clear land1.
*\
*\ select *
*\ into table lfa1
*\ from lfa1
*\*{ INSERT M01K900263
1
*\*
*\*} INSERT
*\*{ REPLACE M01K900263
2
*\*\ where lifnr eq lifnr and land1 eq land1.
*\ where land1 eq land1.
*\*} REPLACE
*\
*\ if sy-subrc ne 0.
*\ raise no_data.
*\ endif.
*} DELETE

*} INSERT
*{ INSERT M01K900263
3
clear t_lfa1.

select *
into table t_lfa1
from lfa1
where land1 eq land1.

if sy-subrc ne 0.
raise no_data.
endif.
*} INSERT

ENDFUNCTION.
*{ REPLACE M01K900263
1
*\

*} REPLACE

Enjoy!

You might also like