cancel
Showing results for 
Search instead for 
Did you mean: 

Help Abap Function Module using APO for SNP

Former Member
0 Kudos

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..

Accepted Solutions (1)

Accepted Solutions (1)

former_member182607
Active Participant
0 Kudos

Hi Johanna,

Why don't you use standard macro function MATLOC_EXTRA() in a macro to get the value?

Thanks,

Subash

Former Member
0 Kudos

Thank's

Thanks, it worked perfectly.

although I'm still in search of that did not work with the code of the function Z.

former_member182607
Active Participant
0 Kudos

Johanna,

Generally SAP has covers most requirements, especially with macros in DP and SNP. I have seen people trying custom codes unaware of standard delivered options. SAP application help is pretty good on these things.

Good luck.....!!!!

Subash

Answers (0)