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: 

How to Export Material and Price/Condition Data

Former Member
0 Kudos

Hi SAPExperts,

I will export Materials with the corresponding Prices. For Material I've IDOC MATMAS01 and for Price/Condition I've IDOC COND_A.

Is it possible to match the two IDOCs inside SAP before export or I had to match them outside SAP after export?

Or is there a way with BAPIs? Which BAPIs?

In summary, which is the best way to realize that?

Thanks,

Frederic

Edited by: Frederic Faisst on Aug 7, 2008 10:21 AM

5 REPLIES 5

former_member611006
Active Participant
0 Kudos

Hi Frederic,

you have to create a Distribution Model / View between the 2 systems, by using Transaction SALE with MATMAS01 and COND_A as Message Type, and the RFC Communication to.

Administration of ALE Functions:

http://help.sap.com/saphelp_nw04/helpdata/en/0b/2a6543507d11d18ee90000e8366fc2/frameset.htm

To create and send Material, you can use 'MASTERIDOC_CREATE_REQ_MATMAS'.

To create and send Price/Condition, use 'MASTERIDOC_CREATE_COND_A'.

Hope this help.

Regards,

David

0 Kudos

Hi David,

the connection between the two systems still exists, I've already realized data change for Account and Contact data.

You wrote:

To create and send Material, you can use 'MASTERIDOC_CREATE_REQ_MATMAS'.

To create and send Price/Condition, use 'MASTERIDOC_CREATE_COND_A'.

MASTERIDOC_CREATE_REQ_MATMAS and MASTERIDOC_CREATE_COND_A are function modules, or?

How can I match them, that a Material has the correct corresponding Price? Is that possible inside SAP or I had to match it after export in my middleware between the two systems?

Thanks,

Frederic

0 Kudos

Hi Frederic,

after selecting and sending the Material you can make something like thid to match Material with Price Condition :

************************************************************************
* Sales-Prices
************************************************************************
* Read Pricing Document  --> T_--WKBP ---------------------------------*
  SELECT * FROM WKBP INTO TABLE T_WKBP
                     FOR ALL ENTRIES IN MARAKEY
                     WHERE MATNR = MARAKEY-MATNR.

* Period of validity --> T_WKBP_VALP ----------------------------------*
  CALL FUNCTION 'PRICING_DOC_VAL_PERIOD_GET'
       EXPORTING
            PI_DATAB       = '19000101'             
*           PI_DATBI       = '99991231'
            PI_KONH_FILL   = 'X'
       TABLES
            PI_T_WKBP      = T_WKBP
            PE_T_WKBP_VALP = T_WKBP_VALP
            PE_T_KONH      = T_KONH
       EXCEPTIONS
            OTHERS         = 1.

* Prepare T_CONDI Table for IDoc ---------------------------------------*
  LOOP AT T_WKBP_VALP WHERE NOT KNUMH_V IS INITIAL.         
*-- Read--> T_KONH -----------------------------------------------------*
    READ TABLE T_KONH WITH KEY KNUMH = T_WKBP_VALP-KNUMH_V  
                               BINARY SEARCH.
    CHECK SY-SUBRC EQ 0.
*-- Save Data into T_CONDI ---------------------------------------------*
    CLEAR T_CONDI.
    MOVE-CORRESPONDING T_KONH TO T_CONDI.
    T_CONDI-A_DATBI = T_WKBP_VALP-DATBI.
    T_CONDI-A_DATAB = T_WKBP_VALP-DATAB.
    APPEND T_CONDI.
  ENDLOOP.
  SORT T_CONDI.
  DELETE ADJACENT DUPLICATES FROM T_CONDI.

* Send Price/Condition IDoc --------------------------------------------*
  CALL FUNCTION 'MASTERIDOC_CREATE_COND_A'
       EXPORTING
            PI_MESTYP                 = 'COND_A'
            PI_LOGSYS                 = RCVPRN
            PI_DIREKT                 = 'X'
            PI_KONH_COMPLETE          = 'X'
            PI_PROTOCOLL              = SPACE
       TABLES
            PIT_CONDITIONS            = T_CONDI
       EXCEPTIONS
            IDOC_COULD_NOT_BE_CREATED = 1
            OTHERS                    = 2.

Regards,

David

Former Member
0 Kudos

Hi Frederic,

i you like to match both IDocs together ... you can use Tcode: BD10

a) check your serialization group at BD44 for GRP_MATMAS or something like that.

Check that the COND_A message is in that group.

if yes ...

1. Enter your Materialnumber at Tcode: BD10

2. Choose MATMAS as Message Type

3. Choose your logical System (defined in the sale and distribution Modell BD64).

4. chck the flaf "send complete" or "full material".

now you are sending the material (MATMAS) together with his COND_A

IF no ...

create or change the serialization group.

0 Kudos

Hi Gordon,

your post is very helpful for me.

I checked TCODE BD44, there exists serialization group GRP_MATMAS with Name "Material master complete". How can I check if COND_A message is in that group? And if it is not, how I can enter COND_A?

I can't find a possibility to do that.

Maybe you can conduct me to do that?

Thanks a lot,

Frederic