Application Development and Automation 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: 
Read only

interface sulution test program

Former Member
0 Likes
989

Leider bin ich kein ABAP Programmierer und benötige jetzt Anfängerhilfe: In FUBA (Se80/SE37) soll ein Schnittstellenfunktionsbaustein testhalber eingerichtet werden. 1. Import allgemeiner Materialdaten aus Ursprungsprogramm (nonSAP) 2. Rückgabe einer Materialnummer (Defaultparameter 10stellig als Bsp) 3. Bei fehlerhaften Importdaten soll Fehlermeldung ausgegeben werden (Infotext/Status) --> Importkonfiguration der Felder funktioniert. --> Rückgabe der Materialnummer mit Defaultnummer für den Funktionstest WIE GEHT DAS??? DEFAULT'123456789'??? --> Fehlermeldung / Infotestausgabe WIE GEHT DAS??? ****************************************************************************************************************** Unfortunately, I'm not a ABAP programmer and now need help beginners: In function builder (Se80/SE37) an interface function module just for pre testing phase should be programmed. 1. Import general material data from the original program (non-SAP) 2. Return a material number (10 digits default parameters as ex) 3. In case of faulty import data error message to be output (info text / status) -> Import configuration of the fields working. -> Return to the material number with default number for the function test HOW DOES IT WORK? DEFAULT'123456789' -> Error / info output test HOW DOES IT WORK? ??? ****************************************************************************************************************** Kann mir jemand eine Richtung geben? Is there anybody coul kindly help me with a direction, any idea? Rgds.

6 REPLIES 6
Read only

Former Member
0 Likes
946

Hi Gudrun,

i will only aswer in english...

There are different ways to solve your issue:

1. Call Transaction BAPI and browse the Logistics->Standard Material branch. Maybe BAPI_STANDARDMATERIAL_CREATE will help you. These BAPIs are RFC-Function-Modules and can be called from outside SAP.

2. Create your own RFC-Compatible-Function Module. You can either call one of the BAPIs oder or the FM MATERIAL_MAINTAIN_DARK. The last mentioned FM allows to create more complex materials with different Plant-Data and so on...

Both ways should return a number or classic MM01/MM02 Errors.

regards

Jan Martin

Read only

0 Likes
946

Hi Jan Martin,

Many thanks for your helpful directions!

The standard FM ... material_maintain_dark... doesn't work as needed, so I've designed an own one. Import section is OK so far. Now export area doesn't work, because I've not capability to

a) give FM some kind of RETURN with a Parameter with a testnumber like 99999999 which should be sent from SAP to the Interface program (nonSAP)

and

b) some kind of RETURN with errormessage in case of error, warning, information

regrads

Gudrun

Read only

0 Likes
946

Hi Gudrun,

please define 2 EXPORTING parameters

E_MATNR type MATNR

E_ERROR type TEXT256

Clear both exporting parameters at begin of source code. If the input is okay, fill E_MATNR with default value, otherwise fill E_ERROR with an error text.

The fm needs "RFC enabled" in its attributes.

You can test your fm in SE37 start screen pressing F8 to enter the test utility.

Regards,

Klaus

Read only

0 Likes
946

You can add RETURN table or simple E_ERROR as mentioned in your wrapper FM

Nabheet

Read only

0 Likes
946

Hi Klaus,

super! Ich habe das jetzt so konfiguriert. Leider finde ich beim besten Willen nicht heraus, WO ich den Default Wert füllen kann. (Errortext und Testmaterialnummer).

Gruß

Gudrun

Read only

0 Likes
946

Hi Gudrun,

in SE37 in the source code ("Quelltext") before endfunction:

CLEAR e_matnr.

CLEAR e_error.

IF i_input EQ '0815'. "<= Replace i_input and '0815' with a valid IMPORT parameter and a valid value

  e_matnr = '9999999999'.

ELSE:

  CONCATENATE i_input 'ist ungueltig' INTO e_error SEPARATED BY SPACE. "<= Replace i_input

ENDIF.

Regards,

Klaus