Logistics Contraction Deleted
Hi,
I have deleted the content in the set up table by using the transaction LBWG. and then i have to initialize the data.When iam trying to initialize the data its giving error "No extraction structure active or BW not connected".but the extract structure was in active position. and also installation from the business content was successful.
i am not getting what might be the problem.
TQ
Kumar
Hi Nantha,
This is your error. Pl activate it, either maunally or by a transport depending on your landscape. After this goes to green, your extractor programs will work.
Do let us know if it helps.
Regards,
Zubin
Similar Messages
-
Hi All,
I want to know any FM can delete Contract. Through(VA42) BDC i am deleting contract but some times its not deleting. So i can do through FM.
Suggest me experts.
Thanks
AmitHi Suresh,
what you can do is to create an Abap Program for selective deletion.
Create a Program by incuding what ever the selection parameters you would require and don't forget to incude Time Characterstics from High to Low level Granularity.
Create a Variant by incuding an infoprovider on which you want to go for selective deletion. You can just change the infoprovider name for further requirement.
If you want you can also incude this selective deletion program in process chain.
Note: It's not advisable to go for selective deltion using selective deletion.
Regards
SujanR -
Error in transferring a Contract from R/3 to SRM
Hi Gurus,
we've implemented SAP SRM on an extended classic scenario with R/3 as the back-end system.
I transfer contracts from the back-end system to SRM by using the BBP_CONTRACT_INITIAL_UPLOAD report.
A problem occurs when the contract in the R/3 sytem has one or more deleted items which are not replicated in the SRM document version. Unfortunatly this causes the disallinement of the two contracts.
So, for instance:
Contract in the R/3 System
1st Item (Deleted)
2nd Item (Active)
3rd Item (Active)
When I transfer it to the SRM system I get:
Contract in the SRM System
1st Item (corresponds to the 2nd Item in the R/3 system)
2nd Item (corresponds to the 3rd Item in the R/3 system)
This means that when I create a PO in the SRM system from that contract using the first position, the PO goes in the error status because R/3 considers the first item of the contract deleted.
How can I fix this problem? Is there a way to let SRM to number the items in the correct way?
In the example I gave, I would like to have my SRM contract with two items (number 2 and 3 which actually match to the number 2 and 3 in the R/3 Contract).
I would really appreciate your help.
Thank you very much,
Giovanni Ottavio Lo Brutto
Edited by: Ottavio Lo Brutto Giovanni on Aug 29, 2008 2:32 PMHello Ganesh,
I did not talk about tab Attributs.
In PPOSA_BBP, one of your Organizational Unit must have in its tab Functions value 'Purch. Organization' set with correspondence in R/3 values (number and logical system).
Regards.
Laurent. -
I use Foldershare as a form of backup and sharing files between machines. Since I reinstalled OS X due to permissions problems I have had issues with synchronising. I get the message that I do not have permission to read or write a file to Trash.
This seems to be connected to file permissions on the data files that I copied back to the Mac post OS X reinstall.
If I go through each file that FS raises as an issue and allow "everyone" to read and write the file is ok, otherwise no go. Similarly I cannot move or delete a file without using my password. Looking endlessly through the Support topics it seems my new ID no longer owns the files - hence needing the password etc.
I have tried the various Terminal commands I have found on topics but still have no success at globally resetting permissions.
Can anyone point me to a command or source of information.
Hope this makes sense and thanks to all those are so helpful in this place.I did that and got a long list of files "not permitted" - examples are:
chown: /Users/JvG/Hill Top/Alice/PSP9/Xerces.dll: Operation not permitted
chown: /Users/JvG/Hill Top/Innovate/Novar/generic logistics contract (novar).doc: Operation not permitted
chown: /Users/JvG/Hill Top/Innovate/Novar/generic logistics contract.doc: Operation not permitted
chown: /Users/JvG/Hill Top/Innovate/Novar/Service Suppliers review - project charter.doc: Operation not permitted
chown: /Users/JvG/Hill Top/Innovate/Novar/TRENDSERVICELEVELAGREEMENT.doc: Operation not permitted
chown: /Users/JvG/Hill Top/Laura/My Music: Operation not permitted
chown: /Users/JvG/Hill Top/Laura/My Pictures: Operation not permitted
chown: /Users/JvG/Hill Top/Thesis/Wages Europe.doc: Operation not permitted
chown: /Users/JvG/Hill Top/Thesis/WAREHOUSE Book.doc: Operation not permitted
chown: /Users/JvG/Hill Top/Thesis/Web sites 12042001.doc: Operation not permitted
chown: /Users/JvG/Hill Top/Thesis/Why Automate Cleco.doc: Operation not permitted
chown: /Users/JvG/Hill Top/Thesis: Operation not permitted
It is only on these directories, Hill Top is my main location for data - should this happen? -
BAPI_CUSTOMERCONTRACT_CHANGE / BAPI_SALESORDER_CHANGE
Hi All,
Can any one help me out for changing sales order partner name(<i>adrc-name1</i>) using the above function modules? I'm not able to find the correct input parameters for these function modules.
Thanks in advance!
Thomas.REPORT ZSD_CONTRACT_INTERACTIVE_RPT.
* Includes
INCLUDE zrdpdmrflowtop.
INCLUDE zrdpdmrflowf01.
INCLUDE zrdpdmrflowf02.
INCLUDE zrdpdmrflowf03.
INCLUDE zrdpdmrflowf04.
INCLUDE zrdpdmrflowf05.
INCLUDE zrdpdmrflowf06.
INCLUDE zrdpdmrflowf07.
* data
data : v_tabix(4) type n,
v_number(4) type n.
CONSTANTS gc_save TYPE syucomm VALUE '&DATASAVE'.
CLASS lcl_event_alv DEFINITION DEFERRED.
FIELD-SYMBOLS <user> LIKE LINE OF zt_ad01repdmr.
DATA :
go_container TYPE REF TO cl_gui_docking_container,
go_alv_grid TYPE REF TO cl_gui_alv_grid,
go_event_alv TYPE REF TO lcl_event_alv,
okcode TYPE syucomm,
gv_okcode TYPE syucomm.
CLASS lcl_event_alv DEFINITION.
PUBLIC SECTION.
METHODS:
h_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row
e_column.
ENDCLASS. " LCL_EVENT_ALV DEFINITION
CLASS lcl_event_alv IMPLEMENTATION.
METHOD h_double_click.
READ TABLE zt_ad01repdmr INDEX e_row-index ASSIGNING <user>.
IF sy-subrc EQ 0.
PERFORM f_user_command USING '&IC1'.
ENDIF.
ENDMETHOD. " H_double_click
ENDCLASS.
*DATA: G_REPID LIKE SY-REPID,
*GS_PRINT TYPE SLIS_PRINT_ALV,
*GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
*GT_EVENTS TYPE SLIS_T_EVENT,
*GT_SORT TYPE SLIS_T_SORTINFO_ALV,
*GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
*GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
*FIELDCAT_LN LIKE LINE OF GT_FIELDCAT,
*COL_POS TYPE I.
*data : wa like gt_ad01repdmr.
LOAD-OF-PROGRAM.
* Get reference to BADI
CALL METHOD cl_exithandler=>get_instance
EXPORTING
exit_name = 'AD01_RRB_REPORTING_1'
null_instance_accepted = seex_true
CHANGING
instance = g_ad01_rrb_reporting_1.
INITIALIZATION.
* SET TITLEBAR 'RDPDMRFLOW'.
AT SELECTION-SCREEN OUTPUT.
* Clear selection of all sales document types except orders
CLEAR: trvog_1,
trvog_2,
trvog_3,
trvog_4,
trvog_5.
* Hide selections of sales document types
LOOP AT SCREEN.
IF screen-name CS 'TRVOG'.
screen-invisible = 1.
MODIFY SCREEN.
ENDIF.
IF screen-name CS 'DD_ERDAT' or screen-name CS 'DD_ERNAM' or
screen-name CS 'DD_BSTNK' or screen-name CS 'DD_VKBUR' or
screen-name CS 'DD_VKGRP' .
screen-invisible = 1.
screen-input = 0.
screen-output = 0.
MODIFY SCREEN.
endif.
ENDLOOP.
* Get data from logical database
GET vbak.
APPEND vbak TO gt_vbak.
GET vbuk.
APPEND vbuk TO gt_vbuk.
GET vbkd.
APPEND vbkd TO gt_vbkd.
GET vbpa.
APPEND vbpa TO gt_vbpa.
GET vbap.
CHECK vbap-posnr IN s_posnr.
CHECK vbap-vkgru = 'I02'.
APPEND vbap TO gt_vbap.
GET vbup.
CHECK vbup-posnr IN s_posnr.
CHECK vbap-vkgru = 'I02'.
APPEND vbup TO gt_vbup.
GET vbkdpo.
CHECK vbkdpo-posnr IN s_posnr.
CHECK vbap-vkgru = 'I02'.
APPEND vbkdpo TO gt_vbkd.
GET vbpapo.
CHECK vbpapo-posnr IN s_posnr.
CHECK vbap-vkgru = 'I02'.
APPEND vbpapo TO gt_vbpa.
END-OF-SELECTION.
* Fill output table
PERFORM read_data
TABLES gt_vbak
gt_vbuk
gt_vbkd
gt_vbpa
gt_vbap
gt_vbup
USING p_selnet
CHANGING gt_ad01repdmr.
* FIlter selected records
perform filter_records.
* Filter completed orders
perform filter_compl_ords.
* Call ALV
call screen 100.
* Module pbo_0100 OUTPUT
MODULE pbo_0100 OUTPUT.
* SET PF-STATUS 'MAIN' EXCLUDING 'SAVE'.
SET PF-STATUS 'MAIN1'.
set titlebar 'TITLE01'.
IF go_container IS INITIAL.
PERFORM create_and_init_alv.
ENDIF.
ENDMODULE. " PBO_0100 OUTPUT
* Module user_command_0100 INPUT
MODULE user_command_0100 INPUT.
gv_okcode = okcode.
CLEAR okcode.
CASE gv_okcode.
WHEN 'BACK'.
SET SCREEN 0.
WHEN 'SAVE'.
PERFORM f_user_command USING gc_save.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
* Form create_and_init_alv
FORM create_and_init_alv.
* Macro definition
DEFINE m_fieldcat.
add 1 to ls_alv_cat-col_pos.
ls_alv_cat-fieldname = &1.
ls_alv_cat-ref_table = &2.
ls_alv_cat-edit = &3.
append ls_alv_cat to lt_alv_cat.
END-OF-DEFINITION.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
ls_sort-up = 'X'.
ls_sort-group = &2.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DATA:
ls_variant TYPE disvariant,
lt_sort TYPE lvc_t_sort,
ls_sort TYPE lvc_s_sort,
lt_alv_cat TYPE lvc_t_fcat,
ls_alv_cat TYPE lvc_s_fcat,
ls_alv_lay TYPE lvc_s_layo,
ls_print TYPE lvc_s_prnt,
l_offline TYPE char1,
lt_toolbar_excl TYPE ui_functions.
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING e_offline = l_offline.
* IF l_offline EQ 0.
CREATE OBJECT go_container
EXPORTING
extension = 2000
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc NE 0.
MESSAGE e208(00) WITH 'The control could not be created'.
ENDIF.
* ENDIF.
* Create an instance of alv control
CREATE OBJECT go_alv_grid
EXPORTING i_parent = go_container.
** Build field catalog and sort table
m_fieldcat 'ZVBELN' 'ZAD01REPDMR1' ''.
m_fieldcat 'ZPOSNR' 'ZAD01REPDMR1' ''.
m_fieldcat 'PERNR' 'ZAD01REPDMR1' ''.
m_fieldcat 'SNAME' 'ZAD01REPDMR1' ''.
m_fieldcat 'VBELN' 'ZAD01REPDMR1' ''.
m_fieldcat 'POSNR' 'ZAD01REPDMR1' ''.
m_fieldcat 'MATNR_SD' 'ZAD01REPDMR1' ''.
m_fieldcat 'ARKTX' 'ZAD01REPDMR1' ''.
* m_fieldcat 'IN_MEGBTR' 'ZAD01REPDMR1' ''.
m_fieldcat 'KWMENG' 'ZAD01REPDMR1' ''.
m_fieldcat 'KLMENG' 'ZAD01REPDMR1' ''.
m_fieldcat 'MVGR5' 'ZAD01REPDMR1' 'X'.
m_fieldcat 'NETWR' 'ZAD01REPDMR1' ''.
m_fieldcat 'WAERK' 'ZAD01REPDMR1' ''.
m_fieldcat 'POSEX' 'ZAD01REPDMR1' ''.
m_fieldcat 'BSTDK' 'ZAD01REPDMR1' 'X'.
m_fieldcat 'ABGRU' 'ZAD01REPDMR1' ''.
m_fieldcat 'OBJID' 'ZAD01REPDMR1' ''.
* m_fieldcat 'OBJTXT' 'ZAD01REPDMR1' ''.
m_fieldcat 'KUNNR' 'ZAD01REPDMR1' ''.
m_fieldcat 'NAME1' 'ZAD01REPDMR1' ''.
m_fieldcat 'VKORG' 'ZAD01REPDMR1' ''.
m_fieldcat 'VTWEG' 'ZAD01REPDMR1' ''.
m_fieldcat 'SPART' 'ZAD01REPDMR1' ''.
m_sort 'ZVBELN' ''. " Line break
m_sort 'ZPOSNR' ''.
* Layout
CLEAR ls_alv_lay.
ls_alv_lay-zebra = ''.
ls_alv_lay-cwidth_opt = 'X'.
* IF l_offline EQ 0.
* Exclude toolbar functions*
* APPEND cl_gui_alv_grid=>mc_fc_detail TO lt_toolbar_excl.
* APPEND cl_gui_alv_grid=>mc_fc_info TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_graph TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_view_crystal TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_delete_row TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_append_row TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_insert_row TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_copy_row TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_undo TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_check TO lt_toolbar_excl.
* APPEND cl_gui_alv_grid=>mc_fc_refresh TO lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_copy to lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_cut to lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_paste to lt_toolbar_excl.
* APPEND cl_gui_alv_grid=>mc_fc_select_all to lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_insert_row to lt_toolbar_excl.
APPEND cl_gui_alv_grid=>mc_fc_loc_paste_new_row to lt_toolbar_excl.
CREATE OBJECT go_event_alv.
SET HANDLER go_event_alv->h_double_click
FOR go_alv_grid.
* ENDIF.
ls_variant-report = sy-cprog.
zt_ad01repdmr_old[] = zt_ad01repdmr[].
* Display
CALL METHOD go_alv_grid->set_table_for_first_display
EXPORTING
is_variant = ls_variant
is_layout = ls_alv_lay
is_print = ls_print
i_save = 'A'
it_toolbar_excluding = lt_toolbar_excl
CHANGING
it_sort = lt_sort
it_outtab = zt_ad01repdmr[]
it_fieldcatalog = lt_alv_cat.
ENDFORM. " CREATE_AND_INIT_ALV
* FORM F_USER_COMMAND *
FORM f_user_command USING u_ucomm LIKE sy-ucomm.
DATA :
l_valid TYPE flag,
lt_message TYPE STANDARD TABLE OF bdcmsgcoll WITH HEADER LINE,
lt_bdcdata TYPE STANDARD TABLE OF bdcdata WITH HEADER LINE.
CASE u_ucomm.
WHEN '&IC1'.
set parameter id 'AUN' field <user>-vbeln.
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
WHEN gc_save.
* Verify changes
CALL METHOD go_alv_grid->check_changed_data
IMPORTING e_valid = l_valid.
CHECK NOT l_valid IS INITIAL.
loop at zt_ad01repdmr .
read table zt_ad01repdmr_old with key vbeln = zt_ad01repdmr-vbeln
posnr = zt_ad01repdmr-posnr
if sy-subrc = 0 and
( ( zt_ad01repdmr-mvgr5 <> zt_ad01repdmr_old-mvgr5 ) or
( zt_ad01repdmr-bstdk <> zt_ad01repdmr_old-bstdk ) ).
* Call sales order change BAPI
perform sales_order_change.
wait up to 3 seconds.
endif.
endloop.
perform popup_userinfo.
zt_ad01repdmr_old[] = zt_ad01repdmr[].
ENDCASE.
ENDFORM. " F_USER_COMMAN
*& Form filter_records
* text
* --> p1 text
* <-- p2 text
FORM filter_records .
data v_tabix like sy-tabix.
if contract <> ''.
loop at zt_ad01repdmr.
v_tabix = sy-tabix.
if zt_ad01repdmr-zvbeln <> CONTRACT.
delete zt_ad01repdmr index v_tabix.
endif.
endloop.
endif.
clear v_tabix.
if line <> ''.
loop at zt_ad01repdmr.
v_tabix = sy-tabix.
if zt_ad01repdmr-zposnr <> line.
delete zt_ad01repdmr index v_tabix.
endif.
endloop.
endif.
clear v_tabix.
if customer <> ''.
loop at zt_ad01repdmr.
v_tabix = sy-tabix.
if zt_ad01repdmr-kunnr <> customer.
delete zt_ad01repdmr index v_tabix.
endif.
endloop.
endif.
ENDFORM.
*& Form sales_order_change
* text
* --> p1 text
* <-- p2 text
FORM sales_order_change .
v_doc = zt_ad01repdmr-vbeln.
i_headin-sales_org = zt_ad01repdmr-vkorg.
i_headin-distr_chan = zt_ad01repdmr-vtweg.
i_headin-division = zt_ad01repdmr-spart.
i_headinx-updateflag = 'U'.
i_orditem-itm_number = zt_ad01repdmr-posnr.
*i_orditem-po_itm_no = zt_ad0repdmr-.
i_orditem-material = zt_ad01repdmr-matnr_sd.
i_orditem-prc_group5 = zt_ad01repdmr-mvgr5.
i_orditem-purch_date = zt_ad01repdmr-bstdk.
append i_orditem.
i_orditemx-itm_number = zt_ad01repdmr-posnr.
i_orditemx-updateflag = 'U'.
i_orditemx-prc_group5 = 'X'.
i_orditemx-purch_date = 'X'.
append i_orditemx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = v_doc
ORDER_HEADER_IN = i_headin
ORDER_HEADER_INX = i_headinx
* SIMULATION =
* BEHAVE_WHEN_ERROR = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* LOGIC_SWITCH =
TABLES
RETURN = i_ret
ORDER_ITEM_IN = i_orditem
ORDER_ITEM_INX = i_orditemx
* PARTNERS =
* PARTNERCHANGES =
* PARTNERADDRESSES =
* ORDER_CFGS_REF =
* ORDER_CFGS_INST =
* ORDER_CFGS_PART_OF =
* ORDER_CFGS_VALUE =
* ORDER_CFGS_BLOB =
* ORDER_CFGS_VK =
* ORDER_CFGS_REFINST =
* SCHEDULE_LINES =
* SCHEDULE_LINESX =
* ORDER_TEXT =
* ORDER_KEYS =
* CONDITIONS_IN =
* CONDITIONS_INX =
* EXTENSIONIN =
if sy-subrc = 0.
v_number = v_number + 1.
v_line = v_doc.
write zt_ad01repdmr-posnr to v_line+12(6).
append i_val.
clear i_val.
endif.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
refresh : i_orditem, i_orditemx.
clear : v_doc, i_headin, i_headinx, i_orditem, i_orditemx, v_line.
ENDFORM. " sales_order_change
*& Form popup_userinfo
* text
* --> p1 text
* <-- p2 text
FORM popup_userinfo .
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
TITEL = ''
TEXTLINE1 = 'No Of Sales Order Lines Changed'
TEXTLINE2 = v_number
* START_COLUMN = 25
* START_ROW = 6
clear v_number.
refresh i_val.
clear i_val.
ENDFORM. " popup_userinfo
*& Form filter_compl_ords
* text
* --> p1 text
* <-- p2 text
FORM filter_compl_ords .
select * from vbuk into table it_vbuk for all entries in zt_ad01repdmr
where vbeln = zt_ad01repdmr-vbeln.
select * from vbup into table it_vbup for all entries in zt_ad01repdmr
where vbeln = zt_ad01repdmr-vbeln.
clear v_tabix.
loop at zt_ad01repdmr.
v_tabix = sy-tabix.
read table it_vbuk with key vbeln = zt_ad01repdmr-vbeln.
if sy-subrc = 0 and it_vbuk-fksak <> 'C'.
if it_vbuk-fksak = 'B'.
read table it_vbup with key vbeln = zt_ad01repdmr-vbeln
posnr = zt_ad01repdmr-posnr.
if sy-subrc = 0 and it_vbup-fksaa = 'C'.
check v_tabix <> '000'.
delete zt_ad01repdmr index v_tabix.
endif.
endif.
else.
check v_tabix <> '000'.
delete zt_ad01repdmr index v_tabix.
endif.
endloop.
ENDFORM. " filter_compl_ords
regards
vijay -
Query related to alv grid and sap script
Hi All,
I have a requirement where i should read the values which are selected on the alv grid list output and those values i need to display on the script(layout).
Help me out guru's its an urgency...
thanks in advance .
regards
ravi ganjiHi Ravi,
I have done it exactly like your requirement. This program contains ALV and Smartform.
But whatever may be, both are layouts and having driver program. So just finish your driver program and Script layout and then use this program.
I have written this code to print contact letters from VA42. So, modify this code to insert your transaction code.
Let me know if you have any questions.
Here is the code.
REPORT ILETTER MESSAGE-ID CM.
TYPE POOLS (ALV)
TYPE-POOLS:
slis.
Customized Types
TYPES:
BEGIN OF ty_cntrt,
box(1) TYPE c,
kunnr TYPE kunag,
vbeln TYPE vbeln_va,
vbeln1 TYPE vbeln_va,
vposn TYPE posnr,
vuntdat TYPE vudat_veda,
vbegdat TYPE vbdat_veda,
vdemdat TYPE vddat_veda,
venddat TYPE vndat_veda,
END OF ty_cntrt,
single line TYPES
BEGIN OF ty_vkorg,
vkorg TYPE vkorg,
END OF ty_vkorg.
Constants
CONSTANTS:
c_sform TYPE char10 VALUE 'SMARTFORMS',
c_tcode TYPE sy-tcode VALUE 'VA42',
c_mode TYPE c VALUE 'N',
c_updat TYPE c VALUE 'A',
c_batch TYPE sy-callr VALUE 'BATCH',
c_dclick TYPE char10 VALUE '&IC1'.
Internal tables
DATA: it_cntrt TYPE TABLE OF ty_cntrt,
it_bdc TYPE TABLE OF bdcdata,
it_mesg TYPE TABLE OF bdcmsgcoll,
it_const TYPE TABLE OF /SIE/SSG_XCM_CUC,
it_vkorg TYPE TABLE OF ty_vkorg.
Work areas
DATA: wa_cntrt TYPE ty_cntrt,
wa_bdc TYPE bdcdata,
wa_const TYPE /SIE/SSG_XCM_CUC,
w_vbak TYPE vbak,
w_veda TYPE veda,
w_xcm_pr TYPE /sie/ssg_xcm_pr,
w_vkorg TYPE ty_vkorg.
Variables
DATA: l_repid TYPE sy-repid,
l_vakey TYPE vakey,
l_variant TYPE varid-variant,
l_vbeln TYPE i,
l_vkorg TYPE i,
l_vkbur TYPE i,
l_vkgrp TYPE i,
l_ckappl(40) TYPE c,
l_ckschl(40) TYPE c,
l_cauart(40) TYPE c.
Program Constants
DATA: c_kappl TYPE kappl,
c_kschl TYPE kschl,
c_auart TYPE auart,
c_repco TYPE /sie/ssg_xcm_const,
c_value TYPE /sie/ssg_xcm_value.
ALV data declarations
DATA:
gt_fieldcat TYPE slis_t_fieldcat_alv,
gt_tab_group TYPE slis_t_sp_group_alv,
gs_layout TYPE slis_layout_alv,
gs_repid TYPE sy-repid,
gs_sort TYPE TABLE OF slis_sortinfo_alv.
Selection screen
SELECTION-SCREEN BEGIN OF BLOCK indletter WITH FRAME TITLE text-001.
skip one line
SELECTION-SCREEN SKIP.
SELECT-OPTIONS:
contract
so_vbeln FOR w_vbak-vbeln,
category
so_auart FOR w_vbak-auart NO-DISPLAY,
Sales Org
so_vkorg FOR w_vbak-vkorg OBLIGATORY,
Dis Channel
so_vtweg FOR w_vbak-vtweg,
Division
so_spart FOR w_vbak-spart,
Sales Group
so_vkgrp FOR w_vbak-vkgrp,
Sales Office
so_vkbur FOR w_vbak-vkbur OBLIGATORY,
Cancellation Procedure
so_vkues FOR w_veda-vkuesch OBLIGATORY,
Contract Signed Date
so_vuntd FOR w_veda-vuntdat,
created by
so_ernam FOR w_vbak-ernam,
Fixed Indexation formula
so_fnum FOR w_xcm_pr-fnum OBLIGATORY.
skip one line
SELECTION-SCREEN SKIP.
Indexation letter
PARAMETERS: rb_index RADIOBUTTON GROUP radi USER-COMMAND usr.
Follow up report
PARAMETERS: rb_follo RADIOBUTTON GROUP radi.
skip one line
SELECTION-SCREEN SKIP.
Manual processing checkbox
PARAMETERS: p_manpr AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK indletter.
Printer block
SELECTION-SCREEN BEGIN OF BLOCK blk_par WITH FRAME TITLE text-002.
Printer
PARAMETERS: p_print LIKE nast-ldest DEFAULT 'LOCL' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk_par.
User selection data validation
AT SELECTION-SCREEN ON so_vkorg.
Ragne for sales org
RANGES: r_vkorg FOR vbak-vkorg.
REFRESH: it_const, r_vkorg.
CLEAR wa_const.
Proceed for execution only for Sales Orgs in /SIE/SSG_XCM_CUC
LOOP AT so_vkorg.
r_vkorg-sign = 'I'.
r_vkorg-option = 'EQ'.
r_vkorg-low = so_vkorg-low.
APPEND r_vkorg.
Check Sales Org intervals entered in the selection screen
IF NOT so_vkorg-high IS INITIAL.
Get all Sales Org for interval
SELECT vkorg FROM tvko INTO TABLE it_vkorg
WHERE vkorg BETWEEN so_vkorg-low AND so_vkorg-high.
IF sy-subrc = 0.
Add all Sales org into one internal table
LOOP AT it_vkorg INTO w_vkorg.
r_vkorg-low = w_vkorg-vkorg.
APPEND r_vkorg.
CLEAR: w_vkorg.
ENDLOOP.
delete repeated records
DELETE ADJACENT DUPLICATES FROM r_vkorg COMPARING low.
ENDIF.
ENDIF.
CLEAR r_vkorg.
ENDLOOP.
Get Sales Org entries maintained in /SIE/SSG_XCM_CUC
l_repid = sy-repid.
Check Sales Org is maintained for Renewal Letter?
LOOP AT r_vkorg.
concatenate constant with Sales Org
CONCATENATE 'INX_LETTER_CREATE_' r_vkorg-low INTO c_repco.
Get constant
SELECT SINGLE value
FROM /sie/ssg_xcm_cuc
INTO c_value
WHERE repid = l_repid
AND const = c_repco
AND vkorg EQ so_vkorg-low.
Check alerady maintained?
IF sy-subrc <> 0 OR
( sy-subrc = 0 AND c_value <> 'X' ).
Issue massage 'Sales Org no permitted for renewal Letter'.
MESSAGE E012.
CLEAR: c_repco, r_vkorg.
EXIT.
ENDIF.
CLEAR: c_repco, r_vkorg.
ENDLOOP.
AT SELECTION-SCREEN.
Read single Sales Org
READ TABLE so_vkorg INDEX 1.
IF sy-subrc = 0.
CLEAR: l_ckappl, l_ckschl, l_cauart, c_kappl, c_kschl, c_auart.
for application
CONCATENATE 'INX_LETTER_V1_' so_vkorg-low INTO l_ckappl.
for output type
CONCATENATE 'INX_LETTER_Y6C4_' so_vkorg-low INTO l_ckschl.
document type
CONCATENATE 'INX_LETTER_AUART_' so_vkorg-low INTO l_cauart.
Get application
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_kappl WHERE repid = sy-repid AND const LIKE l_ckappl.
Get output type
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_kschl WHERE repid = sy-repid AND const LIKE l_ckschl.
Get document type
SELECT SINGLE value FROM /sie/ssg_xcm_cuc
INTO c_auart WHERE repid = sy-repid AND const LIKE l_cauart.
ENDIF.
find no of Sales org entries entered in the selection screen
DESCRIBE TABLE so_vkorg LINES l_vkorg.
find no of Sales office entries entered in the selection screen
DESCRIBE TABLE so_vkbur LINES l_vkbur.
find no of Sales Group entries entered in the selection screen
DESCRIBE TABLE so_vkgrp LINES l_vkgrp.
Check if enterred more than one entry
IF l_vkorg = 1 AND l_vkbur = 1.
add Sales Org, Sales office, Sales group for key
IF NOT so_vkgrp[] IS INITIAL.
CONCATENATE so_vkorg-low so_vkbur-low so_vkgrp-low INTO l_vakey.
ELSE.
CONCATENATE so_vkorg-low so_vkbur-low '%' INTO l_vakey.
ENDIF.
CONDENSE l_vakey.
Get printer name for selection.
SELECT SINGLE ldest FROM nach INTO p_print
WHERE kappl = c_kappl AND kschl = c_kschl AND vakey LIKE l_vakey.
ENDIF.
Manual processing is possible for Renewal Letter in advance only
IF p_manpr = 'X' AND rb_follo = 'X'.
MESSAGE E017.
ENDIF.
Main Processing
START-OF-SELECTION.
Check for the Follow up report
IF rb_follo = 'X'.
Call Follow up report with Selection criteria
SUBMIT /SIE/SWE_XCM_INDEX_FOLLOWUP
USING SELECTION-SET l_variant
WITH so_vbeln IN so_vbeln
WITH so_vkorg IN so_vkorg
WITH so_vtweg IN so_vtweg
WITH so_spart IN so_spart
WITH so_vkgrp IN so_vkgrp
WITH so_vkbur IN so_vkbur
WITH so_vkues IN so_vkues
WITH so_vuntd IN so_vuntd
WITH so_ernam IN so_ernam
WITH so_fnum IN so_fnum
WITH p_kappl EQ c_kappl
WITH p_kschl EQ c_kschl
WITH p_auart EQ c_auart
AND RETURN.
ELSE.
Process for Indexation Report
gs_repid = sy-repid.
Get data.
PERFORM get_data.
Filter data based on Siemens France rules
PERFORM process_data.
Check contract data is available for selection criteria
IF NOT it_cntrt[] IS INITIAL.
create ALV output header
PERFORM alv_fieldcat USING gt_fieldcat[].
create ALV layout
PERFORM alv_layout CHANGING gs_layout.
Sort ALV output
PERFORM alv_sort.
display filtered contract data
PERFORM output_data.
ELSE.
Display a message 'No records found'.
MESSAGE I011.
EXIT.
ENDIF.
ENDIF.
*& Form get_data
Retrieve contracts data from tables
--> p1 text
<-- p2 text
FORM get_data.
Get contract data from VBAK and VEDA.
SELECT avbeln aaudat a~kunnr
bvuntdat bvbegdat
bvdemdat bvenddat
INTO CORRESPONDING FIELDS OF TABLE it_cntrt
FROM vbak AS a INNER JOIN veda AS b
ON avbeln = bvbeln
WHERE a~vbeln IN so_vbeln
AND a~auart EQ c_auart
AND a~vkorg IN so_vkorg
AND a~vtweg IN so_vtweg
AND a~spart IN so_spart
AND a~vkgrp IN so_vkgrp
AND a~vkbur IN so_vkbur
AND a~ernam IN so_ernam
AND b~vposn = '000000'
AND b~vkuesch IN so_vkues
AND b~vuntdat IN so_vuntd.
ENDFORM. " get_data
*& Form process_data
text
--> p1 text
<-- p2 text
FORM process_data.
Internal tables
DATA: l_nast TYPE TABLE OF nast,
it_pr TYPE TABLE OF /sie/ssg_xcm_pr.
Work areas
DATA: w_nast TYPE nast,
wa_pr TYPE /sie/ssg_xcm_pr.
local Variables
DATA: l_datum1 TYPE sy-datum,
l_datum2 TYPE sy-datum,
l_d3last TYPE sy-datum,
l_d3next TYPE sy-datum.
current date.
l_datum1 = sy-datum.
Calcuate date after 3 months.
CALL FUNCTION 'DATE_CREATE'
EXPORTING
ANZAHL_MONATE = 3
DATUM_EIN = l_datum1
IMPORTING
DATUM_AUS = l_datum2.
l_datum2 = l_datum2 - 1.
SORT it_cntrt BY KUNNR VBELN.
Get corresponding records from /SIE/SSG_XCM_PR.
SELECT vbeln posnr fnum
FROM /SIE/SSG_XCM_PR
INTO CORRESPONDING FIELDS OF TABLE it_pr
FOR ALL ENTRIES IN it_cntrt
WHERE vbeln = it_cntrt-vbeln
AND posnr = it_cntrt-vposn
AND fnum IN so_fnum.
clear workarea
CLEAR wa_cntrt.
filter contracts agaist the table /SIE/SSG_XCM_PR records.
LOOP AT it_cntrt INTO wa_cntrt.
CLEAR wa_pr.
check contracts available in table /SIE/SSG_XCM_PR
READ TABLE it_pr INTO wa_pr WITH KEY vbeln = wa_cntrt-vbeln.
IF sy-subrc <> 0.
DELETE it_cntrt.
CLEAR wa_pr.
CONTINUE.
ELSEIF sy-subrc = 0 AND NOT wa_pr-fnum IN so_fnum.
if not available, do not consider this contract
DELETE it_cntrt.
CLEAR wa_pr.
CONTINUE.
ENDIF.
Dont consider contracts expires before today and after 3 months.
IF wa_cntrt-vdemdat > l_datum1. "current date
IF wa_cntrt-vdemdat(6) > l_datum2(6). "AND "after 3 months
delete contract
DELETE it_cntrt.
CLEAR wa_cntrt.
CONTINUE.
ENDIF.
ELSE.
DELETE it_cntrt.
CLEAR wa_cntrt.
CONTINUE.
ENDIF.
Is contract renewal letter has been sent already?
Get all records from NAST to find letter sent?
SELECT kappl objky kschl nacha datvr
FROM NAST
INTO CORRESPONDING FIELDS OF TABLE l_nast
WHERE kappl = c_kappl
AND objky = wa_cntrt-vbeln
AND kschl = c_kschl
AND nacha = '1'.
IF sy-subrc = 0.
sort renewal letter sent dates by latest is first
SORT l_nast BY datvr DESCENDING.
Get latest nast record
READ TABLE l_nast INTO w_nast INDEX 1.
IF sy-subrc = 0.
IF p_manpr <> 'X'. " ignore 3 month logic
l_d3next = wa_cntrt-vdemdat(06).
l_d3next+6(2) = '01'.
Calcuate date after 3 months.
CALL FUNCTION 'DATE_CREATE'
EXPORTING
ANZAHL_MONATE = -3
DATUM_EIN = l_d3next
IMPORTING
DATUM_AUS = l_d3last.
l_d3last = l_d3last + 1.
Check letter already sent year equals current year
IF w_nast-datvr BETWEEN l_d3last AND wa_cntrt-vdemdat.
do not consider it
DELETE it_cntrt.
CLEAR: l_d3last, wa_cntrt, w_nast, l_d3next.
CONTINUE.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
no leading zeros to contract
WRITE wa_cntrt-vbeln TO wa_cntrt-vbeln1 NO-ZERO.
modify internal table
MODIFY it_cntrt FROM wa_cntrt.
CLEAR: l_nast, w_nast.
ENDLOOP.
ENDFORM. " process_data
*& Form output_data
text
--> p1 text
<-- p2 text
FORM output_data.
Display output in a ALV Grid
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = gs_repid
I_CALLBACK_PF_STATUS_SET = 'ALV_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = gs_layout
IT_FIELDCAT = gt_fieldcat
IT_SORT = gs_sort
I_SAVE = 'A'
TABLES
T_OUTTAB = it_cntrt
EXCEPTIONS
PROGRAM_ERROR = 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.
ENDFORM. " output_data
*& Form alv_header
text
--> p1 text
<-- p2 text
FORM alv_fieldcat USING gs_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
Sold-to Party header
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'KUNNR'.
ls_fieldcat-seltext_m = 'Sold-to Party'.
ls_fieldcat-outputlen = 14.
ls_fieldcat-datatype = 'CHAR'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract number
ls_fieldcat-col_pos = 2.
ls_fieldcat-fieldname = 'VBELN'.
ls_fieldcat-seltext_m = 'Contract Number'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-datatype = 'CHAR'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract Signed Date
ls_fieldcat-col_pos = 3.
ls_fieldcat-fieldname = 'VUNTDAT'.
ls_fieldcat-seltext_m = 'Contract signed date'.
ls_fieldcat-outputlen = 20.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Contract Start Date
ls_fieldcat-col_pos = 4.
ls_fieldcat-fieldname = 'VBEGDAT'.
ls_fieldcat-seltext_m = 'Contract start date'.
ls_fieldcat-outputlen = '20'.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
Dismantling date
ls_fieldcat-col_pos = 5.
ls_fieldcat-fieldname = 'VDEMDAT'.
ls_fieldcat-seltext_m = 'Dismantling date'.
ls_fieldcat-outputlen = 14.
ls_fieldcat-datatype = 'DATS'.
APPEND ls_fieldcat TO gs_fieldcat.
CLEAR ls_fieldcat.
ENDFORM. " alv_header
*& Form alv_layout
text
--> p1 text
<-- p2 text
FORM alv_layout USING ls_layout TYPE slis_layout_alv.
No input
ls_layout-no_input = 'X'.
Column width is flexible
ls_layout-colwidth_optimize = 'X'.
ls_layout-box_fieldname = 'BOX'.
ls_layout-info_fieldname = 'LINE_COLOR'.
ls_layout-zebra = 'X'.
ls_layout-get_selinfos = 'X'.
ls_layout-reprep = 'X'.
ENDFORM. " alv_layout
*& Form alv_status
text
--> p1 text
<-- p2 text
FORM alv_status USING rt_extab TYPE slis_t_extab.
GUI Status and Application Toolbar
SET PF-STATUS '/SIE/SWE_XCM_INDEXLE'.
ENDFORM.
*& Form user_command
text
--> p1 text
<-- p2 text
FORM user_command USING l_ucomm LIKE sy-ucomm
l_selfield TYPE slis_selfield.
RANGES: r_kappl FOR nast-kappl,
r_objky FOR nast-objky,
r_kschl FOR nast-kschl,
r_nacha FOR nast-nacha.
DATA: l_jobname TYPE TBTCJOB-JOBNAME,
l_jobcount TYPE TBTCJOB-JOBCOUNT,
l_repid TYPE sy-repid,
l_print_params TYPE PRI_PARAMS,
l_arc_params TYPE ARC_PARAMS,
l_valid TYPE c,
l_retcode TYPE sy-subrc,
l_blines TYPE i.
CASE l_ucomm.
Process button seleted
WHEN c_sform.
process selected records.
LOOP AT it_cntrt INTO wa_cntrt.
IF wa_cntrt-box = 'X'.
place output type in the contract
PERFORM bdc_output USING wa_cntrt
CHANGING l_retcode.
IF l_retcode = 0.
add record for jobground job
r_objky-sign = 'I'.
r_objky-option = 'EQ'.
r_objky-low = wa_cntrt-vbeln.
APPEND r_objky.
ENDIF.
CLEAR: wa_cntrt, l_retcode, r_objky.
ENDIF.
ENDLOOP.
WHEN c_dclick.
set contract number id with the selected contract
SET PARAMETER ID 'AUN' FIELD l_selfield-value.
SET PARAMETER ID 'KTN' FIELD l_selfield-value.
call va42 tcode when double click on contract
CALL TRANSACTION c_tcode AND SKIP FIRST SCREEN.
ENDCASE.
DESCRIBE TABLE r_objky LINES l_blines.
IF NOT r_objky[] IS INITIAL.
IF l_blines > 0.
Background job name.
CONCATENATE 'XCM_INDEXATION' sy-uname '_' sy-uzeit
INTO l_jobname.
Application
r_kappl-sign = 'I'.
r_kappl-option = 'EQ'.
r_kappl-low = 'V1'.
APPEND r_kappl.
Message Type
r_kschl-sign = 'I'.
r_kschl-option = 'EQ'.
r_kschl-low = c_kschl.
APPEND r_kschl.
Message transmission medium
r_nacha-sign = 'I'.
r_nacha-option = 'EQ'.
r_nacha-low = '1'.
APPEND r_nacha.
l_repid = sy-repid.
Print Parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
DESTINATION = p_print
MODE = c_batch
NO_DIALOG = 'X'
REPORT = l_repid
EXPIRATION = 2
IMMEDIATELY = 'X'
NEW_LIST_ID = 'X'
IMPORTING
OUT_ARCHIVE_PARAMETERS = l_arc_params
OUT_PARAMETERS = l_print_params
VALID = l_valid
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
opening the job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = l_jobname
IMPORTING
JOBCOUNT = l_jobcount
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Job submit
SUBMIT /sie/swe_xcm_index_rsnast00 TO SAP-SPOOL
USER sy-uname
WITH s_kappl IN r_kappl
WITH s_objky IN r_objky
WITH s_kschl IN r_kschl
WITH s_nacha IN r_nacha
WITH p_print EQ p_print
VIA JOB l_jobname NUMBER l_jobcount
SPOOL PARAMETERS l_print_params
WITHOUT SPOOL DYNPRO
AND RETURN.
IF sy-subrc <> 0.
display message when error in scheduling background job
MESSAGE E016 WITH 'Error scheduling Job'.
ENDIF.
Job close
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = l_jobcount
JOBNAME = l_jobname
STRTIMMED = 'X'
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM.
*& Form bdc_output
text
--> p1 text
<-- p2 text
FORM bdc_output USING wa_cntrt TYPE ty_cntrt
CHANGING l_retcode TYPE sy-subrc.
DATA: l_nast TYPE TABLE OF nast,
it_nast TYPE TABLE OF nast,
w_nast TYPE nast,
l_cellno(2) TYPE n,
l_vbelv TYPE vbfa-vbelv,
l_vbpa TYPE vbpa,
l_yes(1),
l_temp(40) TYPE c,
l_lines TYPE i,
l_lesscnt TYPE i,
l_less(1),
l_lines1(2) TYPE n.
REFRESH: it_nast, l_nast, it_bdc.
CLEAR: l_nast, w_nast, l_yes, l_cellno,
it_nast, l_nast, it_bdc.
PERFORM dyn_scr USING 'SAPMV45A' '0102' 'X'.
PERFORM dyn_fld USING 'VBAK-VBELN' wa_cntrt-vbeln.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
PERFORM dyn_scr USING 'SAPMV45A' '4001' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=HEAD'.
PERFORM dyn_scr USING 'SAPMV45A' '4002' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=KDOK'.
SELECT *
FROM nast
INTO CORRESPONDING FIELDS OF TABLE l_nast
WHERE kappl = c_kappl
AND objky = wa_cntrt-vbeln.
IF sy-subrc = 0.
SORT l_nast BY kschl vstat.
DESCRIBE TABLE l_nast LINES l_lines.
LOOP AT l_nast INTO w_nast.
l_cellno = sy-tabix.
IF w_nast-kschl = c_kschl AND w_nast-vstat = 0.
EXIT.
ENDIF.
IF w_nast-kschl > c_kschl OR
( w_nast-kschl = c_kschl AND w_nast-vstat <> 0 ).
IF l_less = space.
l_cellno = l_cellno - 1.
ENDIF.
CLEAR l_less.
IF l_cellno = 0.
l_cellno = 1.
ENDIF.
l_lines = l_lines + 1.
l_lines1 = l_lines.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR: l_temp, l_lines, l_lines1.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
EXIT.
ELSEIF w_nast-kschl < c_kschl.
l_less = 'X'.
l_lesscnt = l_lesscnt + 1.
ENDIF.
ENDLOOP.
ELSE.
l_cellno = '01'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
ENDIF.
IF l_less = 'X'.
l_lesscnt = l_lesscnt + 1.
l_cellno = l_lesscnt.
l_lines = l_lines + 1.
l_lines1 = l_lines.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'Y6C4'.
CLEAR: l_temp, l_lines, l_lines1.
PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
ENDIF.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'X'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70P'.
PERFORM dyn_scr USING 'SAPDV70A' '0101' 'X'.
PERFORM dyn_fld USING 'NAST-LDEST' p_print.
PERFORM dyn_fld USING 'NAST-DIMME' 'X'.
PERFORM dyn_fld USING 'NAST-TDARMOD' '1'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
CONDENSE l_temp.
PERFORM dyn_fld USING l_temp 'X'.
CLEAR l_temp.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70I'.
PERFORM dyn_scr USING 'SAPDV70A' '0102' 'X'.
PERFORM dyn_fld USING 'NAST-VSZTP' '1'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
PERFORM dyn_fld USING 'BDC_OKCODE' '=V70S'.
CALL TRANSACTION c_tcode USING it_bdc
MODE c_mode "'N'
UPDATE c_updat "'A'
MESSAGES INTO it_mesg.
IF sy-subrc = 0.
l_retcode = 0.
ENDIF.
ENDFORM. " bdc_output
*& Form dyn_scr
text
-->P_0642 text
-->P_0643 text
-->P_0644 text
FORM dyn_scr USING P_0642
P_0643
P_0644.
MOVE: p_0642 TO wa_bdc-program,
p_0643 TO wa_bdc-dynpro,
p_0644 TO wa_bdc-dynbegin.
APPEND wa_bdc TO it_bdc.
CLEAR wa_bdc.
ENDFORM. " dyn_scr
*& Form dyn_fld
text
-->P_0654 text
-->P_0655 text
FORM dyn_fld USING P_0654
P_0655.
MOVE: p_0654 TO wa_bdc-fnam,
p_0655 TO wa_bdc-fval.
APPEND wa_bdc TO it_bdc.
CLEAR wa_bdc.
ENDFORM. " dyn_fld
*& Form alv_sort
text
FORM alv_sort.
DATA: wa_sortcat TYPE slis_sortinfo_alv.
WA_SORTCAT-SPOS = 1.
WA_SORTCAT-FIELDNAME = 'KUNNR'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
CLEAR wa_sortcat.
WA_SORTCAT-SPOS = 2.
WA_SORTCAT-FIELDNAME = 'VBELN'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
WA_SORTCAT-SPOS = 3.
WA_SORTCAT-FIELDNAME = 'VUNTDAT'.
WA_SORTCAT-UP = 'X'.
WA_SORTCAT-EXPA = 'X'.
Appending gd_sortcat-tabname
APPEND WA_SORTCAT TO gs_sort.
ENDFORM. " alv_sort -
Hi SDN,
In LO if i want to fill setup tables in batches due to high volumes of data, what steps I need to follow from ECC as well as BW side.
Suppose I have 10 years of sales data say 1997 to 2007, I deleted the setup tables and intialized with 2004 to 2007 data, ran init infopackage and applied appropriate update mode and job scheduling options and every day deltas are running to BW. Now I want 2000 to 2003 sales data into my BW system so what steps I should perform to accomplish this?
Please explain me .All your help will be appreciated.
(Full points will be assigned)Hello BI_Boy,
As I do not understand clearly which steps you already took, I explain everything.
The most important thing with setup tables is that no content must be changed during runtime. So, exclude all users from working and stop all jobs. There is a SAP note 602260 which explains this in detail.
If the delta is already working you have to empty the delta queue. Run the corresponding InfoPackage in BW. I recommend to do it twice. If everything works fine you will receive 0 records the second time.
If the setup table was already filled or if you are unsure about this delete their content before initializing them. Start transaction SBIW and drill down to "Settings for Application-Specific DataSources (PI)" - "Logistics" - "Initialization" - "Delete the Content of the Setup Tables". Choose the corresponding application.
The next thing is to (re-)fill the setup table in ECC. In transaction SBIW drill down to "Settings for Application-Specific DataSources (PI)" - "Logistics" - "Initialization" - "Application-Specific Setup of Statistical Data". Select the kind of DataSource you are interested in. Fill in selections if necessary. To run the initialization in background do not click on "Execute". Instead select "Program" - "Execute in Background".
In SM37 of ECC check if the setup jobs finished successfully.
Initialize the delta process in transaction LBWE, if it was not done before.
Now it is time for the BW part. You have to run a delta initialization. I recommend to run it without data transfer. This means that the setup table is not being used and that you should receive 0 records.
After this has been finished successfully your ECC users can start working again.
Finally start a "Full Load" repair InfoPackage. This will load the setup table.
Keep in mind that you may have to delete BW data which was loadad from the affected DataSource before a re-initialization.
Kind regards,
Stefan -
Trying to fill setup table for 2LIS_04_P_ARBPL
Hi
I am trying to delete and fill setup tables for 2LIS_04_P_ARBPL. I go to SBIW, delete setup tables for application component 04 and then go back to fill setup tables. But I get the message "DataSource 2LIS_04_P_ARBPL contains data still to be transferred".
Am I missing a step?
Thanks
PoojaI went to transaction SBIW ->Settings for Application specific datasources ->Logistics->Initialization->Delete contents of setup tables-> Application 04
Then under Initialization I went to Filling in the Setup table->Application specific setup of statistical table ->Production.
I entered the date & time (and entered my own Run name. Should I say new run or rerun or give my own Run name?) and executed the transaction.
Then I got the message - datasource still contains data to be transferred.
Thanks! -
Hi,
Can any one please let me know the important transactions of PRA module? I am new to IS OIL.
Thanks in advance,
Keerthi.Hi
APPLICATION NAME PRA TRANSACTION
Contract Create O3U_CT1
Contract Change O3U_CT2
Contract Delete O3U_CT3
Contract List Processing O3U_CT9
Pricing Terms Create VK11
Pricing Terms Change VK12
Pricing Terms Display VK13
Execute Pricing Report V/LD
Marketing Costs O3UCP_MKT_CST0
Tax / Royalty Reimbursement O3UCP_TAR_RMB0
Oil Price Posting Maintain O3U_PP2
Oil Price Posting Display O3U_PP3
Gravity Scales Maintain O3U_SCM2
Gravity Scales Display O3U_SCM3
Contract / MP Xref O3UCA_TRNCT
Percent Returned to Lease O3UCA_PRL
Gas Plant Sliding Scale O3UCA_GPSS
CO2 Removal Fee Processing O3UCP_CO2_RMV0
Marketing Group Assignment Create O3U_CA011
Marketing Group Assignment Change O3U_CA012
Marketing Group Assignment Display O3U_CA013
Marketing Group Assignment Delete O3U_CA016
Marketing Group Assignment List Processing O3UCA_MKGRPL
Plant Selective Processing O3UCA_PSP
Owner Selective Processing O3UCA_OSP
Delivery Network Dated Create O3U_DND1
Delivery Network Dated Change O3U_DND2
Delivery Network Dated Display O3U_DND3
Delivery Network Dated Delete O3U_DND6
Allocation Cross Reference Create O3U_CA021
Allocation Cross Reference Change O3U_CA022
Allocation Cross Reference Display O3U_CA023
Allocation Cross Reference Delete O3U_CA026
Allocation Cross Reference List Processing O3U_CA029
Network Allocation Selection O3U_RQST
Allocated Volumes Inquiry O3U_CA09
Entitled Volumes Inquiry O3U_CA10
Contract Results Inquiry O3U_CA11
Prior Period Notifications O3U_VPPN9
Revised Owner Availability Change O3U_CA062
Revised Owner Availability Display O3U_CA063
Revised Owner Availability List Processing O3U_CA069
Contract Quantities by Sales Point Change O3U_CA052
Contract Quantities by Sales Point Display O3U_CA053
Contract Quantities by Sales Point List Processing O3U_CA059
Refresh Network Templates O3U_RETMPL
Build Monthly Templates O3U_BLTMPL
Network Imbalances Change O3U_CA042
Network Imbalances Display O3U_CA043
CA Manual Entry Create O3U_CA031
CA Manual Entry Change O3U_CA032
CA Manual Entry Display O3U_CA033
CA Manual Entry Delete O3U_CA036
CA Manual Entry List Processing O3U_CA039
SPF Statement Volumes Create O3U_CA071
SPF Statement Volumes Change O3U_CA072
SPF Statement Volumes Display O3U_CA073
SPF Statement Volumes Delete O3U_CA076
SPF Statement Volumes List Processing O3U_CA079
Valuation Formula ID Create O3U_FRML1
Valuation Formula ID Change O3U_FRML2
Valuation Formula ID Display O3U_FRML3
Valuation Formula ID Delete O3U_FRML6
Valuation Formula Create O3U_VLFR1
Valuation Formula Change O3U_VLFR2
Valuation Formula Display O3U_VLFR3
Valuation Formula Delete O3U_VLFR6
Valuation Formula List Processing O3U_VLFR9
Valuation Cross Reference Create O3U_VCR1
Valuation Cross Reference Change O3U_VCR2
Valuation Cross Reference Display O3U_VCR3
Valuation Cross Reference Delete O3U_VCR6
Valuation Cross Reference List Processing O3U_VCR9
Internal Marketing Rates Create O3U_MKT1
Internal Marketing Rates Change O3U_MKT2
Internal Marketing Rates Change O3U_MKT3
Internal Marketing Rates Change O3U_MKT6
Royalty Processing Allowance O3UVL_RPA0
Marketing Cost Tax Allowance O3UVL_MTA
Tier Tax O3UVL_TTX0
Tax Classification O3UVL_TCL0
Tax Classification List Processing O3UVL_TCL9
Tax Processing Allowance O3UVL_TPA0
State Tax Rates O3UVL_STR0
Tax Calculation Data O3UVL_TCD0
Valuation Document Worklist O3URV_DOC
Valuation Prior Period Notification Selection O3U_PPN02
Valuation Rejects Selection for Delete O3U_RVT02
Valuation Manual Prior Period Notification Create O3U_PPNM01
Valuation Manual Prior Period Notification Change O3U_PPNM02
Valuation Manual Prior Period Notification Display O3U_PPNM03
Valuation Selection Report O3URV_SRPT
Combined Run Report O3URV_COMB
Settlement Statement O3UVL_SS0
Settlement Statement/DOI Cross Reference O3UVL_SST0
Purchaser/Remitter Cross Reference OIUH_VL10
Oil Run Statement List Processing O3UVL_OST9
Oil Statement Profile O3UVL_OSP0
Gas Statement List Processing O3UVL_GST9
Gas Statement Profile O3UVL_GSP0
Run Ticket Inquiry O3UVL_RTI
Regards,
Girish -
Wrong factory calendar assignment to plant
Hi,
We define new plant in customizing and assign a factory calendar ( table T001W ).
I have wrongly assigned a factory calendar BE to German plant in customizing system and moved to changes to production system. Now I want to change this factory calendar from BE to DE in customizing, but the field is greyed out.
Kindly advice.
Regards,
AbhijitAbhijit k wrote:
Hi,
> We define new plant in customizing and assign a factory calendar ( table T001W ).
> I have wrongly assigned a factory calendar BE to German plant in customizing system and moved to changes to production system. Now I want to change this factory calendar from BE to DE in customizing, but the field is greyed out.
>
> Kindly advice.
>
> Regards,
> Abhijit
Hi,
Open Enterprise Structure-Define, copy-Logistics - General-delete, check plant-Define Plant-select your plant and open in detail view-click on Table view from your header and select Displaay-changes.Now you can see your factory calender as editable.
Thanks -
Need info on how to delete Contracts
Hi All,
I am new to SAP R/3. Please provide me info on transactions to create and delete contract and info on FM to delete Contracts in R/3 System..
All helpful answers will be rewarded.
Regards,
UdayaHi Udaya,
Check the UPDATEFLAG as 'D' for the table parameters CONTRACT_ITEM_INX to delete a particular line item in a contract.
Give your line item to BAPISDITMX-ITM_NUMBER and BAPISDITMX-UPDATEFLAG as 'D' to the structure and APPEND this to table parameters
CONTRACT_ITEM_INX .
The required fields to be filled to execute this BAPI are:
1. Only enter fields that you want to change.
2. Mark the fields you want to change with an X.
3. Fill in the UPDATEFLAG field with a U.
4. Always enter the key fields when making changes, including in the checkbox list.
5. An exception is configuration. If you change this, you must fill it in completely.
6. Enter quantities and dates under schedule line data.
7. Possible update flags: U = change
D = delete
I = insert
Thanks,
Vinay -
How to delete the coverages for an ACTIVE service contract ?
Hi ,
I have created coverages for few service lines for a service contract in R12. The contract is in ACTIVE status. If it was in ENTERED state, I could use OKS_COVERAGES_PUB.DELETE_COVERAGE to delete the coverages. But this contract is in ACTIVE status.
Basically I want the lines lse_id=2,3 removed for a particular line (lse_id=1) which were created by using OKS_CONTRACTS_PUB.CREATE_SERVICE_LINE. This contract has a standard coverage and hence there should not be lines with lse_id=2,3 for that particular service line .
Also, I am not able to delete a coverage for an EXPIRED contract.
Please let me know if you need more information on this.Hi 2619098
Did you find a solution for this? I am having the same problem. Please advice.
Regards -
Error while deleting contract line item
Hi All,
In ME32K when I try to delete the line item of the contract it goes to runtime error. Pls help me why I get that error.
It has 3 PO`s created in 2010.Error analysis
A RAISE statement in the program "CL_HANDLE_MANAGER_MM==========CP" raised the
exception
condition "FAILURE".
Since the exception was not intercepted by a superior program
in the hierarchy, processing was terminated.
Short description of exception condition:
For detailed documentation of the exception condition, use
Transaction SE37 (Function Library). You can take the called
function module from the display of active calls.
How to correct the error
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
use the following search criteria:
"RAISE_EXCEPTION" C
"CL_HANDLE_MANAGER_MM==========CP" or "CL_HANDLE_MANAGER_MM==========CM005"
"GET" -
HOW TO DELETE A SUB CONTRACTING PO
Hello Everybody,
I have a scenario where i am trying to delete only Sub contracting PO's. How can i do this. There are all different kinds of PO's being CIFed to APO system but out of those i would like to delete only the Sub contracting PO's between a Plant & a Vendor.
I am planning to use Program /SAPAPO/DELETE_PP_ORDER.
But i am not sure how do i filter the Sub contracting PO.
Best Regards,
KingHello King,
In report /SAPAPO/DELETE_PP_ORDER you can filter orders based on ATP category for deleting only Sub Contracting PO.
Regards, Chirag
Edited by: Chirag Kothari on May 25, 2010 4:56 AM -
Sales Office is not possible to delete in a service contract
Hi
I have set up a Service Desk solution for VAR's which worked fine for the first tests.
I then created a new contract for a new customer.
In CRMD_ORDER was the first contract set up with the following values under the tab Organisation:
Organizational Unit DK SALES DK Sales
Sales Organization DK SALES DK Sales
Distribution Channel 01 Distribution channel 01
Sales Office
Sales Group
Organizational Unit AV DK Application Management DK
Service Organization Gavdi Support Gavdi Support organisation
I then created a new contract which I could not get to default and then I noticed that the Sales Office field was automatically filled, so the data looks like this:
Organizational Unit DK SALES DK Sales
Sales Organization DK SALES DK Sales
Distribution Channel 01 Distribution channel 01
Sales Office DK SALES DK Sales
Sales Group
Organizational Unit AV DK Application Management DK
Service Organization GavdiSupport Gavdi Support organisation
The problem in short is that I am now not able to delete the value in Sales Office again.
In other words, when I delete the text does the line look like this:
Sales Office ___________ DK Sales
And when I save or press enter etc. is the field refieled with the value.
I am then no longer able to find my product with the F4 help or manualy in the "Item details" tab in CRMD_ORDER.
So I guess that I need to do some changes on my product to be able to find it or remove this value.
The product is created with Sales organisation = DK Sales and Distriputions channel = Distribution channel 01.
This is preventing my contract determination to happen.
Any help is very vecome as I am expected to go live with this monday next week..!
Best regards,
Bo Schlichting
Edited by: Bo Schlichting on Apr 20, 2010 10:54 AM
Edited by: Bo Schlichting on Apr 20, 2010 11:15 AMHi,
We've had the same problem for couple of years now. It's quite unbelievable that there's no solution for this. You can search for "Migrate pending" in this document:
http://docs.oracle.com/cd/E17236_01/epm.1112/readme/epma_1112100_readme.html
It's a known issue, but at least best to my knowledge, there's no answer for it. It's embarrassing that if an application duplication goes wrong (for some reason, for us it sometimes just stops at 0%), you cannot delete it. Then you explain your customers, that ok, please renew all your SmartView connections to the new application that you've managed to create.
Maybe you are looking for
-
Switching from one account to another
In order to resolve a problem in what was then my only account, I created a new one. This has solved the basic problem, but it leaves me with some problems. I can't work out whether or not it is possible to transfer things like my Address Book or my
-
How do I reinstall PS6 on a new laptop?
My laptop died. I extracted all of my Adobe photoshop files from the harddrive. I placed them on my new laptop. I now need to install the application but do not have the install file. Where do I find this? I still have my serial number. Thanks
-
The 6000 series had well documented performance issues with a reported throughput of only 15M. Does the 3000 improve upon this or does it perform the same or worse than the 6000?
-
Reverting back from the iCal CalDAV Beta
Upgrading to the new Ical CalDAV Beat, I have lost the ability to collaborate with with co-workers using Outlook 2003. They can not add my calendar events. Also, their calendar events are not longer automatically added to iCal. How can I revert back
-
How to burn dual layer iDVD image with Toast?
OK so I'm a bit of a Mac newbie, but I've bought some DVD+R DLs and tried to burn this project that's filled to the rim (7.7GB, 99 titles). OK, so there's encoding, right? But after that process (which you know takes FOREVER in my case), the MacBook