cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Trsp. Duration

Former Member
0 Kudos

Dear all,

I want to update /SAPAPO/TRM-DURAT in transaction /SAPAPO/SCC_TL5 (in batch mode).

I execute this tx with Source Transp Zone and Destination Trans. Zone, and must update the field /SAPAPO/TRM-DURAT for one of the Means of Transport there.

I'm trying BAPI_TRLSRVAPS_SAVEMULTI but it ends with an error message : "Time-based validities overlap".

Look at this:

DATA: trdesc(30),

gv_matid(22),

gv_meins TYPE /sapapo/meins,

pversion(22).

CONSTANTS c_x VALUE 'X'.

DATA: BEGIN OF record,

location_from TYPE /sapapo/ext_locno,

loctype_loc_from(4),

loctype_loc_to(4),

location_to TYPE /sapapo/ext_locno,

valfr TYPE /sapapo/scc_valfromtstmp,

valto TYPE /sapapo/scc_valfromtstmp,

ttype TYPE /sapapo/tr_traty,

END OF record.

DATA:

p_transport_lane TYPE TABLE OF bapi11201trlane WITH HEADER LINE,

p_transport_lanex TYPE TABLE OF bapi11201trlanex WITH HEADER LINE,

p_prod_procurement TYPE TABLE OF bapi11201sources WITH HEADER LINE,

p_prod_procurementx TYPE TABLE OF bapi11201sourcesx WITH HEADER LINE,

p_means_of_transport TYPE TABLE OF bapi11201meansoftransp WITH HEADER LINE,

p_means_of_transportx TYPE TABLE OF bapi11201meansoftranspx WITH HEADER LINE,

p_prod_means_of_transport TYPE TABLE OF bapi11201prdmeansoftransp WITH HEADER LINE,

p_prod_means_of_transportx TYPE TABLE OF bapi11201prdmeansoftranspx WITH HEADER LINE,

p_carrier TYPE TABLE OF bapi11201carrier WITH HEADER LINE,

p_carrierx TYPE TABLE OF bapi11201carrierx WITH HEADER LINE,

return TYPE TABLE OF bapiret2 WITH HEADER LINE.

DATA: p_dur TYPE bapi11201trmdurat.

record-location_from = 'TZ-PRPBB1'.

record-loctype_loc_from = 1005.

record-loctype_loc_to = 1005.

record-location_to = 'TZ-PDJB05'.

record-valfr = 20080921000000.

record-valto = 20990922235959.

record-ttype = 'SID-Q-BB'.

CONCATENATE 'Tr Lane Between' record-location_from INTO trdesc SEPARATED BY space.

CONCATENATE trdesc '-> ' record-location_to INTO trdesc.

p_transport_lane-location_from = record-location_from.

p_transport_lane-loctype_loc_from = record-loctype_loc_from.

p_transport_lane-location_to = record-location_to.

p_transport_lane-loctype_loc_to = record-loctype_loc_to.

p_transport_lane-short_text_tl = trdesc.

  • p_transport_lane-planner = record-planner.

APPEND p_transport_lane .

IF record-location_from NE ' '.

p_transport_lanex-location_from = record-location_from.

ENDIF.

IF record-loctype_loc_from NE ' '.

p_transport_lanex-loctype_loc_from = record-loctype_loc_from.

ENDIF.

IF record-location_to NE ' ' .

p_transport_lanex-location_to = record-location_to.

ENDIF.

IF record-loctype_loc_to NE ' ' .

p_transport_lanex-loctype_loc_to = record-loctype_loc_to .

ENDIF.

  • IF record-short_text_tl NE ' ' .

  • p_transport_lanex-short_text_tl = c_x.

  • ENDIF.

  • IF record-planner NE ' ' .

  • p_transport_lanex-planner = c_x.

  • ENDIF.

APPEND p_transport_lanex.

CONCATENATE 'Tr Lane Between' record-location_from INTO trdesc SEPARATED BY space .

CONCATENATE trdesc '-> ' record-location_to INTO trdesc.

p_means_of_transport-location_from = record-location_from.

p_means_of_transport-loctype_loc_from = record-loctype_loc_from.

p_means_of_transport-location_to = record-location_to.

p_means_of_transport-loctype_loc_to = record-loctype_loc_to.

p_means_of_transport-valfr = record-valfr.

p_means_of_transport-valto = record-valto.

p_means_of_transport-ttype = record-ttype.

  • p_means_of_transport-valid_all_prds_flg = record-valid_all_prds_flg.

  • p_means_of_transport-aggt_tpl_flg = record-aggt_tpl_flg.

  • p_means_of_transport-dtlt_tpl_flg = record-dtlt_tpl_flg.

  • p_means_of_transport-short_text_tm = record-short_text_tm.

p_means_of_transport-short_text_tm = trdesc.

  • p_means_of_transport-trcal = record-trcal.

p_dur = 350.

p_means_of_transport-duration = p_dur.

  • p_means_of_transport-durfx_flg = record-durfx_flg.

  • p_means_of_transport-distfx_flg = record-distfx_flg.

  • p_means_of_transport-trans_cost = record-trans_cost.

  • p_means_of_transport-trans_cost_uom = record-trans_cost_uom .

  • p_means_of_transport-dur_rnd_value = record-dur_rnd_value.

  • p_means_of_transport-treq_cover_type = record-treq_cover_type.

  • p_means_of_transport-tlb_profile = record-tlb_profile.

APPEND p_means_of_transport.

p_means_of_transportx-location_from = record-location_from.

p_means_of_transportx-loctype_loc_from = record-loctype_loc_from.

p_means_of_transportx-location_to = record-location_to.

p_means_of_transportx-loctype_loc_to = record-loctype_loc_to.

p_means_of_transportx-ttype = record-ttype.

IF record-ttype NE ' ' .

p_means_of_transportx-ttype = c_x.

ENDIF.

  • IF record-valid_all_prds_flg NE ' ' .

  • p_means_of_transportx-valid_all_prds_flg = c_x.

  • ENDIF.

  • IF record-aggt_tpl_flg NE ' ' .

  • p_means_of_transportx-aggt_tpl_flg = c_x.

  • ENDIF.

  • IF record-dtlt_tpl_flg NE ' ' .

  • p_means_of_transportx-dtlt_tpl_flg = c_x.

  • ENDIF.

  • IF record-short_text_tm NE ' ' .

  • p_means_of_transportx-short_text_tm = c_x.

  • ENDIF.

IF trdesc NE ' ' .

p_means_of_transportx-short_text_tm = c_x.

ENDIF.

  • IF record-trcal NE ' ' .

  • p_means_of_transportx-trcal = c_x.

  • ENDIF.

IF p_dur NE ' ' .

p_means_of_transportx-duration = c_x.

ENDIF.

  • IF record-durfx_flg NE ' ' .

  • p_means_of_transportx-durfx_flag = c_x.

  • ENDIF.

  • IF record-distfx_flg NE ' ' .

  • p_means_of_transportx-distfx_flg = c_x.

  • ENDIF.

  • IF record-trans_cost NE ' ' .

  • p_means_of_transportx-trans_cost = c_x.

  • ENDIF.

  • IF record-trans_cost_uom NE ' ' .

  • p_means_of_transportx-trans_cost_uom = c_x .

  • ENDIF.

  • IF record-dur_rnd_value NE ' ' .

  • p_means_of_transportx-dur_rnd_value = c_x.

  • ENDIF.

  • IF record-treq_cover_type NE ' ' .

  • p_means_of_transportx-treq_cover_type = c_x.

  • ENDIF.

  • IF record-tlb_profile NE ' ' .

  • p_means_of_transportx-tlb_profile = c_x.

  • ENDIF.

APPEND p_means_of_transportx.

*----


*CALL OF PERFORM TO CALL BAPI to create/update transportation lane with means of transport

*----


PERFORM bapi_call.

*----


*BAPI CALL

*----


FORM bapi_call.

CALL FUNCTION 'BAPI_TRLSRVAPS_SAVEMULTI'

EXPORTING

logical_system = 'TSD_210'

* business_system_group =

model = '000'

commit_control = 'E'

* auto_delete = ' '

TABLES

transport_lane = p_transport_lane

transport_lanex = p_transport_lanex

prod_procurement = p_prod_procurement

prod_procurementx = p_prod_procurementx

means_of_transport = p_means_of_transport

means_of_transportx = p_means_of_transportx

prod_means_of_transport = p_prod_means_of_transport

prod_means_of_transportx = p_prod_means_of_transportx

carrier = p_carrier

carrierx = p_carrierx

return = return.

*----


*Confirm the document creation by calling database COMMIT

*----


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

ENDFORM.

Actually the record contains :

Means of Transport = SID-Q-BB

Start Date: 21-9-08

End Date: 23-9-08

Duration: 315

Etc

If you have any idea, please help me.

Thanks and Regards,

Liliana

Accepted Solutions (1)

Accepted Solutions (1)

tibor_nagy
Contributor
0 Kudos

Dear Liliana,

please implement report /SAPAPO/TR_CONS_CHECK as defined in note 1153905 and execute it to remove all transportation lane related inconsistencies.

I hope this helps.

Regards,

Tibor

Former Member
0 Kudos

Thanks but the report was no use.

After executing it, the bapi did not update the field Transport Duration.

Any more idea please?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Liliana,

Please check the Transportation lanes you are uploading/editing. It appears you had already uploaded a lane with some Validity. While the same is being uploaded again with a different validity.

You have to check the Existing TLanes and the ones you are trying to upload or any duplication. Omit the duplicate ones and try again...

Regards,

Manjit

Former Member
0 Kudos

Hi,

I want to UPDATE the field Transportation Duration in the existing records (not to CREATE) of /SAPAPO/TRM.

So, I am filling the fields in the structure of the bapi with the same values I can see in tx /SAPAPO/SCC_TL5.

I'm not creating new records.

Thanks,

Liliana

Former Member
0 Kudos

Hi ,

Check these OSS notes 1077961 and 1077903.Might be the APO service pack issue.

Regards,

Nikhil

Former Member
0 Kudos

Please check SLG1 log by time to get some more clue.

Check below OSS note they are not directly connected.

Note 850199 - TL-MASS: Product procurement cannot be updated

Note 853031 - TL-MASS: Product procurement cannot be updated(II)

Manish