2006 Aug 20 11:49 PM
Hi all,
I have a problem with this update program and I need some help with the same.
here is the code:
report update.
tables: proj, prps, aufk, afvc, afko, afvu.
data: aufnr type aufk-aufnr.
data: cuobj type afko-cuobj.
data: itab type conf_out occurs 0 with header line.
selection-screen begin of block b1 with frame title text-001.
select-options so_date for sy-datum default sy-datum.
select-options so_pspnr for prps-pspnr.
parameters: p_aufnr type aufk-aufnr.
selection-screen end of block b1.
*select aufnr from aufk into aufnr where pspel in so_pspnr.
select single cuobj from afko into cuobj where aufnr = p_aufnr.
CALL FUNCTION 'VC_I_GET_CONFIGURATION_IBASE'
EXPORTING
INSTANCE = cuobj
BUSINESS_OBJECT =
LANGUAGE = SY-LANGU
IV_INVALID_POSSIBLE = ' '
IV_NEUTRAL = ' '
TABLES
CONFIGURATION = itab.
ET_CONF_WITH_AUTHOR =
EXCEPTIONS
INSTANCE_NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at itab.
if itab-atnam = 'pst_appn'.
* afvu-zz_aodfield25 = itab-atbez.
endif.
if itab-atnam = 'SG_APPS'.
itab-atbez = afvu-zz_aodfield25.
endif.
if itab-atnam = 'pst_appn_vrsn'.
afvu-zz_aodfield26 = itab-atbez.
endif.
if itab-atnam = 'pst_appn_spck'.
afvu-zz_aodfield27 = itab-atbez.
endif.
if itab-atnam = 'pst_tool_vrsn'.
afvu-zz_aodfield28 = itab-atbez.
endif.
if itab-atnam = 'pst_tool_plvl'.
afvu-zz_aodfield29 = itab-atbez.
endif.
if itab-atnam = 'pst_soln_type'.
afvu-zz_aodfield30 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_prps'.
afvu-zz_aodfield31 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_fctn'.
afvu-zz_aodfield32 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_clfn'.
afvu-zz_aodfield33 = itab-atbez.
endif.
if itab-atnam = 'pst_host_name'.
afvu-zz_aodfield34 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_modl'.
afvu-zz_aodfield35 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_cpu'.
afvu-zz_aodfield36 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr-ram'.
afvu-zz_aodfield37 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr-cnfg'.
afvu-zz_aodfield38 = itab-atbez.
endif.
if itab-atnam = 'pst_os'.
afvu-zz_aodfield39 = itab-atbez.
endif.
if itab-atnam = 'pst_db'.
afvu-zz_aodfield40 = itab-atbez.
endif.
if itab-atnam = 'pst_san_storage'.
afvu-zz_aodfield41 = itab-atbez.
endif.
if itab-atnam = 'pst_san_strg_1'.
afvu-zz_aodfield42 = itab-atbez.
endif.
if itab-atnam = 'pst_clustered'.
afvu-zz_aodfield43 = itab-atbez.
endif.
if itab-atnam = 'pst_load_blnr'.
afvu-zz_aodfield44 = itab-atbez.
endif.
if itab-atnam = 'pst_hba'.
afvu-zz_aodfield45 = itab-atbez.
endif.
if itab-atnam = 'pst_nic'.
afvu-zz_aodfield46 = itab-atbez.
endif.
if itab-atnam = 'pst_inet'.
afvu-zz_aodfield47 = itab-atbez.
endif.
modify afvu .
if sy-subrc <> 0.
rollback work.
message 'Update unsuccessful.' type 'E'.
else.
commit work.
message 'Update successful.' type 'I'.
endif.
endloop.
Thanks in advance.
regards,
sukumar.
2006 Aug 21 12:21 AM
Now that I see they are Z fields, this is ok. I think Neil is right, You need to check for the values as upper case.
if itab-atnam = <b>'pst_appn_vrsn'</b>.
afvu-zz_aodfield26 = itab-atbez.
endif.Here you need to change the value in BOLD to uppercase.
if itab-atnam = <b>'PST_APPN_VRSN'</b>.
afvu-zz_aodfield26 = itab-atbez.
endif.Regards,
Rich Heilman
Now that I see they are Z fields, this is ok. I think Neil is right, You need to check for the values as upper case.
if itab-atnam = <b>'pst_appn_vrsn'</b>.
afvu-zz_aodfield26 = itab-atbez.
endif.Here you need to change the value in BOLD to uppercase.
if itab-atnam = <b>'PST_APPN_VRSN'</b>.
afvu-zz_aodfield26 = itab-atbez.
endif.Regards,
Rich Heilman
2006 Aug 20 11:55 PM
Hi all,
I tried debugging it.
...the value of itab-atbez, does not get into afvu-zz_aodfield25. I tried changing the places. Both the fields have the same data type.
Regards,
sukumar.
2006 Aug 20 11:56 PM
2006 Aug 20 11:59 PM
in which situation exactly do you expect the value to be getting updated? Does the update work for other cases?
I notice that your test mixes upper and lower case. What case does the one not working have?
To update (or modify) AFVU you need AFVU to hold values in the key fields:
AUFPL
APLZL
Have you read these already? I couldn't see that in the code.
2006 Aug 21 12:17 AM
2006 Aug 21 12:21 AM
Now that I see they are Z fields, this is ok. I think Neil is right, You need to check for the values as upper case.
if itab-atnam = <b>'pst_appn_vrsn'</b>.
afvu-zz_aodfield26 = itab-atbez.
endif.Here you need to change the value in BOLD to uppercase.
if itab-atnam = <b>'PST_APPN_VRSN'</b>.
afvu-zz_aodfield26 = itab-atbez.
endif.Regards,
Rich Heilman
2006 Aug 21 12:32 AM
Hi Rich,
I tried this,
if itab-atnam = 'SG_APPS'.
afvu-zz_aodfield25 = itab-atbez.
endif.
still it does not work.
the value exits in itab-atbez, but it doesnot get into afvu-zz_aodfield25. The data type is the same in both the fields too. Im really confused.
Regards,
Sukumar.
2006 Aug 21 12:36 AM
2006 Aug 21 12:40 AM
2006 Aug 21 12:43 AM
2006 Aug 21 12:44 AM
2006 Aug 21 12:47 AM
Hi Rich,
I have defined the z fields to ave the same data type (atbez) as itab the value does not move , but then sy-subrc = 0.
Regards,
Sukumar.
2006 Aug 21 12:50 AM
To update (or modify) AFVU you need AFVU to hold values in the key fields:
AUFPL
APLZL
2006 Aug 21 1:06 AM
Hi,
Now the value seems to be moving into the z field, but the table doesnot get updated.
Regards,
Sukumar.
2006 Aug 21 1:07 AM
Hi,
The code is here for the reference.
report code.
tables: proj, prps, aufk, afvc, afko, afvu.
data: aufnr type aufk-aufnr.
data: cuobj type afko-cuobj,
aufpl type afko-aufpl.
data: itab type conf_out occurs 0 with header line.
selection-screen begin of block b1 with frame title text-001.
select-options so_date for sy-datum default sy-datum.
select-options so_pspnr for prps-pspnr.
parameters: p_aufnr type aufk-aufnr.
selection-screen end of block b1.
*select aufnr from aufk into aufnr where pspel in so_pspnr.
select single cuobj from afko into cuobj where aufnr = p_aufnr.
select single aufpl from afko into aufpl where aufnr = p_aufnr.
CALL FUNCTION 'VC_I_GET_CONFIGURATION_IBASE'
EXPORTING
INSTANCE = cuobj
BUSINESS_OBJECT =
LANGUAGE = SY-LANGU
IV_INVALID_POSSIBLE = ' '
IV_NEUTRAL = ' '
TABLES
CONFIGURATION = itab.
ET_CONF_WITH_AUTHOR =
EXCEPTIONS
INSTANCE_NOT_FOUND = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at itab.
if itab-atnam = 'pst_appn'.
* afvu-zz_aodfield25 = itab-atbez.
endif.
if itab-atnam = 'SG_APPS'.
afvu-zz_aodfield25 = itab-atbez.
endif.
if itab-atnam = 'pst_appn_vrsn'.
afvu-zz_aodfield26 = itab-atbez.
endif.
if itab-atnam = 'pst_appn_spck'.
afvu-zz_aodfield27 = itab-atbez.
endif.
if itab-atnam = 'pst_tool_vrsn'.
afvu-zz_aodfield28 = itab-atbez.
endif.
if itab-atnam = 'pst_tool_plvl'.
afvu-zz_aodfield29 = itab-atbez.
endif.
if itab-atnam = 'pst_soln_type'.
afvu-zz_aodfield30 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_prps'.
afvu-zz_aodfield31 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_fctn'.
afvu-zz_aodfield32 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_clfn'.
afvu-zz_aodfield33 = itab-atbez.
endif.
if itab-atnam = 'pst_host_name'.
afvu-zz_aodfield34 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_modl'.
afvu-zz_aodfield35 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr_cpu'.
afvu-zz_aodfield36 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr-ram'.
afvu-zz_aodfield37 = itab-atbez.
endif.
if itab-atnam = 'pst_srvr-cnfg'.
afvu-zz_aodfield38 = itab-atbez.
endif.
if itab-atnam = 'pst_os'.
afvu-zz_aodfield39 = itab-atbez.
endif.
if itab-atnam = 'pst_db'.
afvu-zz_aodfield40 = itab-atbez.
endif.
if itab-atnam = 'pst_san_storage'.
afvu-zz_aodfield41 = itab-atbez.
endif.
if itab-atnam = 'pst_san_strg_1'.
afvu-zz_aodfield42 = itab-atbez.
endif.
if itab-atnam = 'pst_clustered'.
afvu-zz_aodfield43 = itab-atbez.
endif.
if itab-atnam = 'pst_load_blnr'.
afvu-zz_aodfield44 = itab-atbez.
endif.
if itab-atnam = 'pst_hba'.
afvu-zz_aodfield45 = itab-atbez.
endif.
if itab-atnam = 'pst_nic'.
afvu-zz_aodfield46 = itab-atbez.
endif.
if itab-atnam = 'pst_inet'.
afvu-zz_aodfield47 = itab-atbez.
endif.
if afvu-aufpl = aufpl.
modify afvu .
if sy-subrc <> 0.
rollback work.
message 'Update unsuccessful.' type 'E'.
else.
commit work.
message 'Update successful.' type 'I'.
endif.
endif.
endloop.
2006 Aug 21 1:11 AM
2006 Aug 21 1:29 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |