Skip to Content
0
Former Member
Apr 22, 2014 at 09:02 PM

Help Abap Function Module using APO for SNP

160 Views

Why does not this function I created abap. To use a macro in SNP.

My case is as follows. For parameters Product, Location, I get this value / SAPAPO/MATLOC-AT105, representing a value in inventory.

I created the function abap. When tested in the SNP planning folder with macro. Generates a DUMP ERROR

CALL_FUNCTION_NOT_FOUND

CX_SY_DYN_CALL_ILLEGAL_FUNC

-------------------------------------------------

Der Funktionsbaustein "ZVSCMPULLINVM" werden soll aufgerufen.

Er ist nicht in der Bibliothek jedoch zu finden.

Error in the ABAP Application Program

The current ABAP program "GP4XLHDMOVDV2H3L6TVMGR0PKY0" had to be terminated porque has come across a statement That unfortunately can not be executed.

-------------------------------------------------- ----------------------------------

The macro is used as follows: ZINVENTARIOM (ACT_PRODUC; ACT_LOCATION).

-------------------------------------------------- ----------------------------------

I have the following code segment

FUNCTION ZINVENTARIOM.

* "------------------------------------------------ ----------------------

* "*" Local Interface

* "TABLES

* "VALUE_TAB STRUCTURE / SAPAPO / VALUE_TAB

* "CHANGING

* "REFERENCE (F_ARGUMENT) TYPE / SAPAPO / MXVAL OPTIONAL

* "REFERENCE (F_CALC_ERROR) TYPE C OPTIONAL

* "------------------------------------------------ ----------------------

READ TABLE INTO VALUE_TAB gs_param TRANSPORTING STRING INDEX 1.

w_param1 = gs_param-string.

p_producto = w_param1.

IF sy-SUBRC NE 0.

EXIT.

ENDIF.

READ TABLE INTO VALUE_TAB gs_param TRANSPORTING STRING INDEX 2.

w_param1 = gs_param-string.

p_ubicacion = w_param1.

IF sy-SUBRC NE 0.

EXIT.

ENDIF.

F_ARGUMENT = it_materiales-at105.

clear: value_tab.

refresh: value_tab.

Searches *****

SELECT * FROM / SAPAPO / MATKEY

INTO CORRESPONDING FIELDS OF TABLE it_productos

WHERE MATNR EQ p_producto.

READ TABLE it_productos index 1.

IF sy-SUBRC = 0.

MOVE TO it_productos-matid v_matid.

ENDIF.

SELECT * FROM / SAPAPO / LOC

INTO CORRESPONDING FIELDS OF TABLE it_ubicaciones

WHERE locno p_ubicacion EQ.

READ TABLE it_ubicaciones index 1.

IF sy-SUBRC = 0.

MOVE TO it_ubicaciones-locid v_locid.

ENDIF.

SELECT * FROM / SAPAPO / MATLOC

INTO CORRESPONDING FIELDS OF TABLE it_materiales

WHERE matid = v_matid

AND locid = v_locid.

READ TABLE it_materiales index 1.

IF sy-SUBRC = 0.

MOVE TO it_materiales-at105 at105-INV_MOST.

APPEND INV_MOST.

ENDIF.

anyone have any comments that you can solve. I'm starting in SCM

thank you..