on ‎2017 Sep 06 3:09 AM
Hi Friends,
Env- BPC10.1/Custom logic badi
I am trying to achieve the functionality of Move in BPC Badi.
Example. - original record in the bpc cube
Account Company Time Category CC Signeddata
XXXX YYYY 2017.09 Actual 10101 $500
we need this result
Account Company Time Category CC Signeddata
XXXX YYYY 2017.09 Actual 10101 $0
XXXX ZZZZ 2017.09 Actual 10101 $500
Company code needs to be updated on the original transaction. We get company from a property of CC.
I am able to update the signeddata to zero on the original transaction, but I am not able to update the company code on the original transaction.
LOOP AT ct_data ASSIGNING <ls_data>.
CLEAR lw_cc.
READ TABLE it_CC INTO lw_cc WITH KEY ID = <ls_data>-cc BINARY SEARCH.
IF sy-subrc EQ 0.
lw_temp = <ls_data>.
<ls_data>-company = lw_cc-company //try 1-not updating
<lw_temp>-company = lw_cc-company //try 2 -not updating
lw_temp-signeddata = 0. //works
APPEND lw_temp TO it_temp.
CLEAR lw_temp.
ENDIF.
ENDLOOP.
APPEND LINES OF it_temp TO ct_data.
Thanks
Ed
Request clarification before answering.
Steps:
1. Create a new standard table to store new records like ct_data - for example <lt_new_records>. With line <ls_new_record>
2. LOOP ct_data ASSIGNING <ls_record>.
3. Copy: <ls_new_record> = <ls_record>.
4. Change company for <ls_new_record>
5. APPEND <ls_new_record> TO <lt_new_records>.
6. ENDLOOP.
7. LOOP AT <lt_new_records> ASSIGNING <ls_new_record>.
APPEND <ls_new_record> TO ct_data.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vadim, it worked well. I was able to clear an intersection of data as well as update the company by creating additional records.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vadim for your reply.
Do I need to take a copy of the existing line and update the company code to it, then append it back to ct_data.
This is what I did, <lw_temp1> is a copy of the a line of ct_data, (<ls_data>)
when I try to assign a value to it, it does not update while I am debugging the code
lw_temp1 = <ls_data>.
<lw_temp1>-company = lw_cc-company." - does not update the value of <lw_temp1>-company
<lw_temp1>-company = '1000' . " hard coded- does not update the value <lw_temp1>-company
Does the assignment need to be done a different way
I could not find threads in sdn related to this topic 😞
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"I am able to update the signeddata to zero on the original transaction, but I am not able to update the company code on the original transaction." - you have to create a new record with required company code and add it to ct_data!
P.S. You can't "update" the company code on the original transaction
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.