cancel
Showing results for 
Search instead for 
Did you mean: 

Contracts in SRM

Former Member
0 Kudos

Hello all, I am working in SRM 5.0 and I want to send purchase contracs to R/3 backend system.

I have all configure:

- Transaction types and document types are the same (PCTR)

- Number range is external in R/3 and internal in SRM

- Purchasing organization and purchasing group are OK in PPOMA

- WE20, WE21 and WE42 are OK

But I created a new contract in SRM and I can´t see it in R/3.

I checked SMQ1 and SMQ2, RZ20 and ST22 and I can´t see any error or something similar.

Where can I see if the document is sendng?

Tanks in advance

Rosa Rodríguez

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Rosa,

Run CLEAN_REQREQ_UP Job and check status in BBP_CTR_MON transaction.

Did you implement BBP_DETERMINE_LOGSYS BADI to send the contract to backend?

SG

Former Member
0 Kudos

Hello SG, no! I think this is the problem.

Can you help me with some code to implement CONTRACT_LOGSYS_DETERMINE method?

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

what is the eror in BD87 for 51 in ECC system . you must get en error.

what is the status of GOA status now .

technical status and header status too.

GCTR or PCTR ....

normally internally we do say PCTR is Local contract.

Former Member
0 Kudos

Rosa,

All you have to do in that method is set the logical system to your backend system and that should push the contract to backend.

I believe thiswill only create the contract in ECC. Not in SRM.

SG

Edited by: SRMUSER123 on May 6, 2010 7:49 AM

Former Member
0 Kudos

Hello Muthu, I think I am missunderstanding something here.

1) Can I send one simple contract (PCTR document) from SRM to R/3? I want to create this document type in SRM and then send it to backend as a contract with same document type.

2) I know that I can create GOA documents in SRM and then send them to backend system. Do I need another configuration?

Thanks in advance

Rosa Rodríguez

Former Member
0 Kudos

Rosa,

I am assuming you are on SRM 5.0.

As of SRM 5.0...

Local Contracts in SRM can only be created locally or send to ECC using BBP_DETERMINE_LOGSYS. However, they cannot be created in both systems as far as I know.

GOA on the other hand can be created in SRM and distributed to multiple backend systems. The limitation with GOA is, they can be used in sourcing.

SG

former_member183819
Active Contributor
0 Kudos

Till SRM 550 , local contracts for local SRM and it is valid for only Extended classic scenario.

SG explained well.

Muthu

Former Member
0 Kudos

Hello, mi version is SRM 5.0

Then I can create only GOA documents and send them to backend system as purchase contracts or scheduling agreements, it is correct?

I have only this possibility. I can´t create SRM contracts (local contracts) in SRM and send them to backend. Have both documents in both systems. It is correct no?

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

in SRM 5.0

GOA create in SRM and send to BACK end system as Pur chasing contract and Scheduling agreement possible. But Local contract can not be distributed to backend system till SRM 550.

muthu

Former Member
0 Kudos

Hello, I activated BADI BBP_DETERMINE_LOGSYS with this code:

method IF_EX_BBP_DETERMINE_LOGSYS~CONTRACT_LOGSYS_DETERMINE.

DATA: wa_items TYPE bbp_pds_transfer_item.

READ TABLE it_items INTO wa_items INDEX 1.

IF sy-subrc = 0.

cv_logsys = 'ECDCLNT101'.

ENDIF.

endmethod.

I created another GOA with a distribution contract and I can´t see it in backend system.

I checked SMQ1, SMQ2, RZ20, ST22 transactions and all is OK.

I checked BD87 in backend system too and there is nothing about SEDCLNT110 that is my SRM system.

Where can I see what is the problem?

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

Local contract you can not push to backend though you push with big hammer.

GOA - what is the contract status in SRM

you go to backend BD87 51 STATUS CODE. Here you cn see the error why GOA was not posted to ECC system or check your SRM outboiund queue .. is it stil awatiting?

Muthu

Former Member
0 Kudos

GOA status is released. I have workflow activated to release automatically.

In backend system I checked BD87 transaction and there is nothing about SEDCLNT110 that is my SRM system.

Message type must be BLAREL right? I can´t see nothing about it.

What can I do?

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

header status

above basic data

in distribution or Distribution incorrect ?

muthu

Former Member
0 Kudos

Hello Muthu, these are status that appears in BBP_PD transaction in SRM system:

HEADER I1015 Awaiting Approval X

HEADER I1021 Created

HEADER I1038 Complete

HEADER I1141 Released

HEADER I1180 Document Completed

HEADER I1193 In Distribution

0000000001 I1143 Item is Active

Transfer:

LogSys EntryDate EntryTime DocType CoreKey

ECDCLNT101 10.05.2010 14:55:15 CC 4900000015/0000000009//C

But I checked ME33K transaction and I can´t see the contract.

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

Hi

so your contract has some bad data .

in web what is the status

In distribution or distribution in correct.

what is the error you get inBD87 51 ON CONTRACT POSTING DATE.

THERE YOU WILL GET CLUE.

mUTHU

Former Member
0 Kudos

Hello Muthu, in the web the status are these:

Complete

Created

Released

In Distribution

Document Completed

Item Data status is Active.

In BD87 in backend system I can´t see nothing about this contract.

Only there are IDOCs with status OK for RSINFO, RSSEND, ORDERS, ALEAUD, ORDRSP and RSRQST.

What can I do?

Thanks in advance

former_member183819
Active Contributor
0 Kudos

in bd87 51 (eec) BLOARD you must get a meaningful error message . update here.

--

in GOA

Basisc data

header

Transaction Type Glob.Outline Agrmnt

Status Released | Complete | in distribution or distribution incorrect tell us.

Muthu

Former Member
0 Kudos

Hello Muthu, in header, status is:

Released | Complete | In Distribution

And in BD87 in ECC backend system I can´t see nothing with this message type.

I don´t know what is the error.

Could be the vendor or the product that I am using or something similar?

Thanks

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

in distribution - also

The GOA must have reached ECC .

BBPD_CTR_IDOCREF - this table you must have reference on which IDOC was carrying the GOA to ECC.

do you have entry in this table.

send me screens to g ..mailll idddddddd discuss further in the offline.

Muthu

Former Member
0 Kudos

Hello Muthu! I sent you information via email...

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

Hi

I saw it . Idocs numbers are not generated . since it is 0000000000

i smell a rat in your BLOARD settings. revisit all your MESSAGE settings.

BLOARD reference was no where reference there . in ECC i dont find any BLOARD inbound message normally it helps the data to receive from the QUEUE and post it to backend successfully.

can any one confirm above the same.

since i could not see ROSA BLOARD message in BD87 as BLOARD message in ECC

Muthu

Former Member
0 Kudos

Hello Muthu, I checked all settings with configuration guide and I think all is OK but IDOC is not generated.

In SRM:

WE21 transaction

Under transactional RFC I created port A000000002 with RFC destination ECDCLNT101 (backend system)

WE20 transaction

Under Partner type LS

I created partner number ECDCLNT101, type LS, without outbound parameters and with inbound parameters: BLAREL (message type) and BLAR (process code), "Cancel Processing After Syntax Error" checked and Trigger immediately.

In backend system (101 client):

WE21 transaction

Under transactional RFC I created port A000000012 with RFC destination SEDCLNT110 (SRM system)

WE20 transaction

Under Partner type LS

I created partner number SEDCLNT110, type LS, with outbound parameters: BLAREL (message type) and Receiver port A000000012, "Tranfer IDOC immediately" checked, basic type BLAREL02 and "Cancel Processing After Syntax Error" checked too.

Inbound parameters: BLAORD (message type) and BLAO (process code), "Cancel Processing After Syntax Error" checked and Trigger immediately and COND_A (message type) and COND (process code), "Cancel Processing After Syntax Error" checked and Trigger immediately.

I can´t see the error

Can you help me please?

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

ok. seems t be ok. why idoc numbers are not generated in that ref table so it has to registered there.

i believe idoc numbers generated no problem.

can you distribute model view once again from srm system to ECC system . what we do in bd64 in srm. let us see.

OR

check your outbound queue contra ct.

or generated or not

I feel doubt that your outbound queue not genrated. CONTRACT data indeed goes via QUEUE to ECC and post into the ECC . debug or set break point B46B_CTR_TRANSFER

after approval of GOA this FM might called to transfer the contract from ECC to SRM via queues. keep eye on it.

or lock the sm59 user before you approve it. and queues will be held in srm side and not transmitted to ecc system and make ensure that queuses are generated correctly. if queues are not generated you can raise oss message . dont forget poin..............ts... if your problem fully resolved...

Muthu

Former Member
0 Kudos

Rosa,

Run CLEAN_REQREQ_UP job and check if you see any errors in BBP_CTR_MON ITS Transaction. Did you use any pricing conditions? You may need to map them in backend system. Check OSS note 646903 for some tips & tricks with GOA's.

SG

former_member183819
Active Contributor
0 Kudos

Hi SG

her idoc ref table has 0000000 as idoc reference. i believe QUEUES itself not generated from SRM to ECC or queues not posted to backend.

What do you think.

Muthu

Former Member
0 Kudos

Muthu,

I would say run META_CTR_TRANSFER FM with logical system and GOA GUID and debug for errors. Also, no code is required in BBP_DETERMINE_LOGSYS if it is GOA.

SG

Edited by: SRMUSER123 on May 11, 2010 11:00 AM

former_member183819
Active Contributor
0 Kudos

yes. try to push contract using FM . let us see

Former Member
0 Kudos

Hello, I created another GOA now. I don´t have any pricing conditions in SRM. I don´t put pricing conditions in the contract. I created one basic GOA.

I checked SMQ1 for outbound queue and I can´t see nothing, the queue is not generated.

I have to open an OSS note to SAP or check another FM or what?

Thanks in advance

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

1. step GOA create

2. lock sm59 user in both directions

3. approve the GOA

4. Now Queue must be generated in SRM

5. if you dont get the queue generated in SRM . you can create OSS message to SAP for quick help.

Muthu

Former Member
0 Kudos

I run FM META_CTR_TRANSFER and the result was:

CORE_DESTINATION ECDCLNT101

CORE_DIALOG_DEST ECDCLNT101_DIAL

CORE_LOGICAL_SYS ECDCLNT101

as ET_CONTROL_RECORD entries.

All other entries are 0.

I use only Logical system for ECC backend and GUID for contract to run FM

Thanks

Rosa Rodríguez

former_member183819
Active Contributor
0 Kudos

Hi SG

Who really posted this data in ECC system BBPD_CTR_IDOCREF

she has logical system /contract number /purchase org but contract refere idoc as 00000000000. why ?

interesting thing here message number as 03 not even 19.

--

rosa

currency / payterm are missing in that table. why ? do you have currenct in that GOA.

Muthu

Former Member
0 Kudos

Rosa,

Run CLEAN_REQREQ_UP job. It appears you are having problems mapping some fields in ECC. Typically you have to map Condition records, payment terms.

SG

former_member183819
Active Contributor
0 Kudos

Hi SG

document tab will not clear . i st Idoc must posted correctly in ECC and then only clean job must check the data posted are correct with docuemnt data . now GOA really not posted but DOCUMENT tab has entry. hope now you understand her problem.

ROSA : - i want answer what is the results.

1. step GOA create

2. lock sm59 user in both directions

3. approve the GOA

4. Now Queue must be generated in SRM

5. if you dont get the queue generated in SRM . you can create OSS message to SAP for quick help.

Muthu

Muthu

Former Member
0 Kudos

I do not think there is any Queue problem as IDOC reference entries are getting set on backend.

Try running FM META_CTR_CHECK from SRM with GOA# and backend system as logical system. That should return the error messages.

Essentially, it is equivalent to running CLEAN_REQREQ_UP.

SG

former_member183819
Active Contributor
0 Kudos

ok. SG . let Rosa replies ..let us wait for Rosa replies.

for ex. in the ref table she got entry message as 03 rather than blank or 019 .why ?

Muthu

Former Member
0 Kudos

Hi Rosa,

Have you taken care about Condtions Mapping, ECC Contract relavent conditions mapping to SRM Contract pricing conditions? Do you have any scales distributed?

Did you try debuging as per the Point-7 in Note - 646903. Which Reads..You have created and released a global outline agreement.

" You now want to carry out a mapping of the condition data, for example, and debug

the transfer to the back end system as well. The global outline

agreement is automatically transferred to the back end system after

approval. To analyze this manually, you must first of all create a

breakpoint in the B46B_CTR_TRANSFER function module, and manually set

the SV_DEBUGGER variable to X during debugging. This variable ensures

that the call is made directly to the BE in debugging mode. Call the

BBP_PD_CTR_TRANSFER function module using the appropriate object ID

for the outline agreement. You still have to enter the logical system

in addition to the object ID, and you can then execute the module in

debugging mode."

All the best,

- Vamsi

Former Member
0 Kudos

Hello SG, I run META_CTR_CHECK FM and I had this:

ET_CTR_DISTR_MESSAGES: Errors occurred in mapping operation for conditions data

ET_CONTROL_RECORD

R_KEY VALUE

CORE_DESTINATION ECDCLNT101

CORE_DIALOG_DEST ECDCLNT101_DIAL

CORE_LOGICAL_SYS ECDCLNT101

But if I am not using conditions in the GOA, this could be a problem?

Thanks in advance

Rosa Rodríguez

Former Member
0 Kudos

We encountered same problem -- Finally we found that the enhancement we did for mapping of SRM Condition types to ECC Condition types enhancement has a minor problem, which prevented to create IDOCs. Use BBP_CTR_BE_CREATE method CONTRACT_INTERFACE_FILL for any mapping of SRM Conditions to ECC Conditions.

Good Luck!

- Vamsi

former_member183819
Active Contributor
0 Kudos

Yes Rosa

Vamsi is correct.

you need to map ECC and SRM condition header level and item level

SG/vamsi thoughts works out for you..

Muthu

ALWAYS THESE badiS IMPLEMENTEND for GOA

-- see sap note Note 646903 - Global outline agreement: Tips and tricks----

1. Mapping master data or Customizing data

For some master data, such as vendor and location, mapping tables already exist in SRM. The system automatically takes account of these tables when it distributes the outline agreement. For other data, such as products or condition types, there are no mapping tables in SRM. If mapping is required, you can execute it in the following Business Add-Ins (BAdIs):

In SRM: BBP_CTR_BE_CREATE

In R/3: BBP_CTR

You can find a sample implementation for the BBP_CTR_BE_CREATE BADI in the 'CONTRACT_INTERFACE_FILL.txt' document in the attachments of this note.

The standard R/3 system does not have an '01CT' condition type, but the EBP contract does. Therefore, either create this condition type in R/3 or map this condition type as described in the example implementation.

-


Former Member
0 Kudos

Rosa,

Put code in BBP_CTR (MODIFY_DATA_CTR) implementation in ECC to map SRM condition codes to ECC condition codes on all three condition internal tables.

SRM ECC

-


01CT PB00

01RA RB00

01RH RA01

01RP RA00

SG

former_member183819
Active Contributor
0 Kudos

Great SG for good break.

These two BADis are called SAP surgery BADIs for GOA. thats why SAP might come up with XI technology rather than IDOC technology transfer the COntract from SRM to ECC.

Muthu

Former Member
0 Kudos

Guys,

I am on SRM 7 and ECC Eph4 working on central contracts and the following are working as standard:

1. Central contract --> central contract in BE

1a. Call-off from Central contract in BE

2. Central Contract --> Sch Agr in BE

2a. Delivery schdule in BE has no price, currently working on this issue and will let you all know if any thing missing.

Thanks

Former Member
0 Kudos

Hello Muthu, ok! now the IDOC is generated.

I have this entrie in the table:

101 SEDCLNT110 4900000020 1 0000000000426052 4900000020 0011 EUR

But when I checked BD87 transaction in backend system I have this error:

No batch input data for screen SAPMM06E 0514

Another question. I have two contracts in distribution tab, how can I send these two contracts to backend system?

I have only one IDOC generated not two. Second IDOC is this:

101 SEDCLNT110 4900000020 4 0000000000000000 4900000020 0011 019 EUR.

Same as last time without BADIs implementation.

How can be the error?

Thaks in advance

Rosa Rodríguez

Former Member
0 Kudos

Prog & Screen SAPMM06E 0514 -- States that P.Org does not assigned to the given Company code.

You must Determine the company code in BADI BBP_CTR in ECC based on the Plant (we are getting in Segment E1EDP01-WERKS) Using table T001K and update Company code in E1EDK14-ORGID and E1EDK14-QUALF as 011.

All the best,

Vamsi

Former Member
0 Kudos

Hello Vamsi, I have this code in the BADI:

method IF_EX_BBP_CTR~MODIFY_IDOC_DATA_CTR.

constants: c_lc_e1edp01(7) type c value 'E1EDP01'," Constant to hold E1EDP01

c_lc_e1edk14(7) type c value 'E1EDK14'," Constant to hold E1EDK14

c_lc_e1edp19(7) type c value 'E1EDP19'," Constant to hold E1EDK14 " Vendor Consignment Logic ->

c_lc_orgid(3) type c value '011'. " Constant to hold value 011

  • Declaration for Local Work Areas

data: wa_ls_t001k type t001k, " W.A for t001k

wa_ls_edidd type edidd, " W.A for idoc

wa_ls_e1edp01 type e1edp01, " W.A for segment e1edp01

wa_ls_items type bbps_ctr_mm_item. " W.A for communication structure

  • Declaration for Local Variables

data: ws_c_lv_bukrs type bukrs. " Variable too hold comp.code

data: ws_i_lv_index type i. " Variable for integer

  • Declaration for Field Symbols

field-symbols: type e1edp01. " For segment e1edp01

  • Initialize the Local VAriables

clear: wa_ls_t001k, wa_ls_edidd, wa_ls_e1edp01, ws_c_lv_bukrs.

  • Read the required IDoc entry

read table ct_blaord into wa_ls_edidd

with key segnam = c_lc_e1edp01.

if sy-subrc eq 0.

  • Extract the SDATA

wa_ls_e1edp01 = wa_ls_edidd-sdata.

  • Select the appropiate Company Code

select single bukrs from t001k

into ws_c_lv_bukrs

where bwkey = wa_ls_e1edp01-werks.

if not ws_c_lv_bukrs is initial.

  • Finally update the Company Code selected in the IDoc

loop at ct_blaord assigning -sdata+3(4) = ws_c_lv_bukrs.

endif.

endloop. "LOOP AT ct_blaord

endif. "IF NOT ws_c_lv_bukrs

endif. "IF sy-subrc EQ 0.

endmethod.

Could be an error in the customizing? or this changes has to be done only in the BADI?

Thanks in advance

Rosa Rodríguez

Former Member
0 Kudos

Rosa,

For the second part of your question, are you distributing GOA at header level? I am wondering how you have two contracts being distributed from a single GOA. Are you distributing to two different Purch Org/Companies in the same backend?

SG

Former Member
0 Kudos

Pls check below things,

1. After IDOC Created in ECC,in WE02 Check if you have E1EDK14 Segment with Qualifier 011, and value as Company code corresponding to P.ORg and Plant you had given in Distribution of GOA.

2. Can you pls ask your ABAPer to post the same IDOC in WE19 in foreground (in standard Posting program system creates Contracts using BDC for Transaction ME31K.

Let us try to Distribute this GOA as Purchasing contract for single Plant before trying for multiple plants.

All the best,

Vamsi

Former Member
0 Kudos

Hello Vamsi, I have several problems with this.

1.- I am creating a GOA with two release authorized purchasing organizations in Distribution tab in the header:

First release authorized purchasing organization is 0011 and second one is 0002

First item generated IDOC with error in ECDCLNT101 (backend system to do tests).

Second item generated IDOC but with number 0000000000000 in ECDCLNT100 (other backend system).

Why is generating entries in different systems? How can I see why the system is sending one contract to 100 client and other to 101 client?

2.- I know that when in table BBPD_CTR_IDOCREF doesn´t appears IDOC with number.

100 SEDCLNT110 4900000020 1 0000000000000000 4900000020 0002 004

The problem is with BADI BBP_CTR and BBP_CTR_BE_CREATE. But what can be happened?

3.- I checked all settings that you told me in the IDOC and I have this:

E1EDK14 009 - OrgID 001

E1EDK14 014 - OrgID 0011 (this is my purchasing organization)

E1EDK14 013 - OrgID GCTR (this is contract document type)

E1EDK14 011 - OrgID /

4.- I checked IDOC with message type COND_A and I have this error:

Document 4900000025 does not exist

Item 00001 does not exist

Please can you help me? I think that the problem is in the BADIS code.

Thanks in advance

Rosa Rodríguez

Former Member
0 Kudos

Hello SG, this is the document that I am doing.

I am creating a GOA with two release authorized purchasing organizations in Distribution tab in the header:

First release authorized purchasing organization is 0011 and second one is 0002

Rosa Rodríguez

Former Member
0 Kudos

Point 1:

When you have 2 Distributions at Header --> Then total 4 IDOCS 2 for BLAORD & 2 IDOCS for COND_A should be generated in the same system.

Can you pls check what is happening in if you use only one P.Org at distribution.?

Point 2:

All Qualifier are correct, but why 011 is coming \ it should be the company code as per the code you mentioned rite.

Point 3:

Yes that is how it works. When BLAORD fails COND_A will fail with that Error message.

Regards,

Vamsi

Former Member
0 Kudos

Hello Vamsi,

But why can be happened that one purchasing organization is going to 100 backend system and other purchasing organization to another 101 backend system? Which can be the reason?

In case that I created a GOA with only one released purchasing organization. If the purchasing organization is 0011, IDOCS are generated OK but with error that I sent you in the last post. If the purchasing organization is 0002, IDOCS are generated with number 0000000000....

I don´t know the reason why the parameters in the IDOC are not OK.

I have this code in the BADIS:

BBP_CTR_BE_CREATE

method IF_EX_BBP_CTR_BE_CREATE~CONTRACT_INTERFACE_FILL.

  • Declaration for Local Constants

CONSTANTS: c_gctr(4) TYPE c VALUE 'GCTR'. "Constant to hold value GCTR

  • Declaration for Local Internal Tables

DATA: i_lt_smc_map_cond TYPE TABLE OF ZTSRM_CONDITION. " Itab for Table ZTSRM_CONDITION

  • Declaration for Local Work Areas

DATA: wa_ls_smc_map_cond TYPE ZTSRM_CONDITION. " W.A for Table ZTSRM_CONDITION

  • Declaration for Local field symbols

FIELD-SYMBOLS: TYPE bbpbapicondit."For Comm. structure bbpbapicondit

  • Declaration for Local variables

DATA: ws_c_lv_varkey TYPE bbpbapicondct-varkey. " Variable to hold Character 100

  • Initialize all the local declarations

CLEAR: i_lt_smc_map_cond, wa_ls_smc_map_cond, ws_c_lv_varkey.

  • This BADI is applicable only for the GCTR type contracts

CHECK cs_be_header-process_type EQ c_gctr.

  • Select all the mapping values available

SELECT * FROM ZTSRM_CONDITION

INTO TABLE i_lt_smc_map_cond.

  • Just skip the other process when no mapping entries are maintained

CHECK sy-subrc EQ 0.

LOOP AT ct_be_items ASSIGNING .

  • Prepare teh VARKEY

MOVE -number_int5 TO ws_c_lv_varkey10.

  • Start with the main condition table

LOOP AT ct_be_cnd_ct ASSIGNING

WHERE varkey = ws_c_lv_varkey.

  • Get the corresponding mapping value from the custom table

READ TABLE i_lt_smc_map_cond INTO wa_ls_smc_map_cond

WITH KEY COND_SRM = -cond_type.

  • If entries are found perform mapping, if not skip these tasks

IF sy-subrc = 0.

  • Loop appropiately to the condition types and modify the SRM condition types values

  • with ECC condition types values maintained

LOOP AT ct_be_cnd_hd ASSIGNING -cond_no ).

  • All modifications to ct_be_cnd_it should be done here

-cond_type = wa_ls_smc_map_cond-COND_R3.

ENDLOOP. "LOOP AT ct_be_cnd_it

  • All modifications to ct_be_cnd_hd should be done here

-cond_type = wa_ls_smc_map_cond-COND_R3.

ENDLOOP. "LOOP AT ct_be_cnd_hd

ENDIF.

  • All modifications to ct_be_cnd_ct should be done here

c_lc_orgid(3) type c value '011'. " Constant to hold value 011

  • Declaration for Local Work Areas

data: wa_ls_t001k type t001k, " W.A for t001k

wa_ls_edidd type edidd, " W.A for idoc

wa_ls_e1edp01 type e1edp01, " W.A for segment e1edp01

wa_ls_items type bbps_ctr_mm_item. " W.A for communication structure

  • Declaration for Local Variables

data: ws_c_lv_bukrs type bukrs. " Variable too hold comp.code

data: ws_i_lv_index type i. " Variable for integer

  • Declaration for Field Symbols

field-symbols: type e1edp01. " For segment e1edp01

  • Initialize the Local VAriables

clear: wa_ls_t001k, wa_ls_edidd, wa_ls_e1edp01, ws_c_lv_bukrs.

  • Read the required IDoc entry

read table ct_blaord into wa_ls_edidd

with key segnam = c_lc_e1edp01.

if sy-subrc eq 0.

  • Extract the SDATA

wa_ls_e1edp01 = wa_ls_edidd-sdata.

  • Select the appropiate Company Code

select single bukrs from t001k

into ws_c_lv_bukrs

where bwkey = wa_ls_e1edp01-werks.

if not ws_c_lv_bukrs is initial.

  • Finally update the Company Code selected in the IDoc

loop at ct_blaord assigning -sdata+3(4) = ws_c_lv_bukrs.

endif.

endloop. "LOOP AT ct_blaord

endif. "IF NOT ws_c_lv_bukrs

endif. "IF sy-subrc EQ 0.

endmethod.

Thanks in advance

Rosa Rodríguez