CS11, CS12 - Function Module
Hi All,
I am building a infoset-query to read a multi-level BOM just like CS11 or CS12, so i would like to know which Function Module should i call in the program?
Await inputs.
Vivek
Hi Sankaran,
Thank you very much for your inputs. I will work on the infoset based on your inputs & keep you updated, if it fulfils my requirement.
Vivek
Feedback:
May i know which function module reads a multi-level BOM, i tested each function module, but the function call gives an error.
Can you please let me know which fileds in the function module the following field refers to?
1. Material
2. Plant
3. Alternative BOM
4. BOM application
5. Valid from
6. Change Number
7. Revision Level
8. Required Quantity
Await your inputs
Message was edited by:
Vivek
Similar Messages
-
Hi Guys,
My requirement is to give multiple selection in CS12 report
How to find out the function module of CS12
How to generates Z report out of that
Thanks and regards
Thamizhchelvan GHi,
Pls check below function module, this will suitable for your requirement.
CS_BOM_EXPL_MAT_V2
for test Goto TCode SE37 and enter this function module and test it
Regards,
Sankaran -
CS11 &CS12- Moving Price and standard price not appering for items
Dear Gurus,
CS11 &CS12- Moving Price and standard price not appering for items.
is it a bug for my system alone\.
or a bug overall in SAP itself.
Pls advise.
SivaDear Siva,
Its the standard functionality of SAP.
You will not get any cost related data in the reports like CS11,CS12,CS13.
You can try CK13N(which shows the components of the BOM along with the cost) or else CK86_99.
At Functional module level execute this one CS_BOM_EXPL_MAT_V2 and ensure X is included for the
input field MBWLS.
And also check these SAP notes 177006 and 686509.
Check and revert back.
Regards
Mangalraj.S -
Function module to get the BOM details for a material-plant combination
hi
Is there any function module to get the BOM details such as
BOM Usage -STLAN
Alternative BOM -STLAL
Items -POSNR
Required Quantity-EMENG
Resulting Quantity-MENGE
Unit of measure -BMEIN
Base unit of measure-MEINS
for a given material-plant combination
if so please suggest me some FMs.................
Awaiting for ur reply..............try the below fm it may be useful for you
DATA : BEGIN OF I_BOM OCCURS 0.
INCLUDE STRUCTURE STPOX.
DATA : END OF I_BOM.
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = 'PP01'
DATUV = SY-DATUM
MEHRS = 'X'
MTNRV = P_MATNR
WERKS = P_WERKS
TABLES
STB = I_BOM
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
just befor use it check your application area.for my case it is PP01. you can find it in CS12 when you are exploding the bom the value you are giving in BOM application that is the value for CAPID.
Just go to se37 and checkout the fm it has lot of options here I am using the minimum things.
regards
shiba dutta -
BADI /BAPI /Function Module in PP
PP Experts,
I need help to identify the BADI /BAPI /Function Module in PP for
BOM Explosion multilevel (TXn CS11)
Planned Order Create and Change (Txn MD11/MD12)
Production Order Create and Change (CO01/CO02)
Simulation Order (Co01S/Co02S)
Appreciate your valuable inputs.
Thanks and Regards,
PradeepHi,
Following Enhancements available for the said T-Codes
Transaction Code - CS11 Display BOM Level by Level
Enhancement
PCSD0014 Wissensbasierte AuftragsStl:Status setzen beim fixieren
PCSD0013 Customer-specific processing of an explosion for BOM browse
PCSD0012 Customer - Mat. number/mat. number during material exchange
PCSD0011 Knowledge-based order BOM, parallel update
PCSD0010 Order/WBS BOM, determine explosion date
PCSD0009 Order/WBS BOM, determine URL page
PCSD0008 WBS BOM: Customer-specific explosion for creating
PCSD0001 Applications development R/3 BOMS
PCSD0002 BOMs: Customer fields in item
PCSD0003 BOMs: Customer fields in header
PCSD0004 BOM comparison
PCSD0005 BOMs: component check for material items
PCSD0006 Mass changes user exit
PCSD0007 Check changes in STKO
Business Add-in
BOM_EXIT BOM User Exit
BOM_IPPE iPPE Checks Within BOM Maintenance
BOM_UPDATE Maintain BOMS
CEWB_BOM_CUS_FIELDS EWB: Customer Fields with BOM Header (Screen Enhancement)
CEWB_BOM_UPDATE Check Bill of Material on Saving
CEWB_ITM_CUS_FIELDS EWB: Customer Fields with BOM Item (Screen Enhancement)
Transaction Code - MD11/MD12 Create Planned Order
Enhancement
LMDR2001 User exits restr. profiles of opt. pur.ord.-based load bldg
LMDZU001 User exits in additional planning
Transaction Code - CO01/CO02/CO01S/CO02s Create production order
Enhancement
PPCO0010 Enhancement in make-to-order production - Unit of measure
PPCO0012 Production Order: Display/Change Order Header Data
PPCO0013 Change priorities of selection crit. for batch determination
PPCO0015 Additional check for document links from BOMs
PPCO0016 Additional check for document links from master data
PPCO0017 Additional check for online processing of document links
PPCO0018 Check for changes to production order header
PPCO0019 Checks for changes to order operations
PPCO0021 Release Control for Automatic Batch Determination
PPCO0022 Determination of Production Memo
PPCO0023 Checks Changes to Order Components
STATTEXT Modification exit for formatting status text lines
PPCO0009 Enhancement in goods movements for prod. process order
CCOWB001 Customer exit for modifying menu entries
COIB0001 Customer Exit for As-Built Assignment Tool
COZF0001 Change purchase req. for externally processed operation
COZF0002 Change purchase req. for externally procured component
PPCO0001 Application development: PP orders
PPCO0002 Check exit for setting delete mark / deletion indicator
PPCO0003 Check exit for order changes from sales order
PPCO0004 Sort and processing exit: Mass processing orders
PPCO0005 Storage location/backflushing when order is created
PPCO0006 Enhancement to specify defaults for fields in order header
PPCO0007 Exit when saving production order
PPCO0008 Enhancement in the adding and changing of components
Business Add-in
SIDAT_UPDATE Change date of price simulation
CAUFVD_CHANGE BAdI: Overall Network Scheduling with Selection Option
AFABD_CHANGE Change Relationship
PPPI_SEL_ORD_EXT_REL
Regards
Ahsan -
For level in BOM component explosure . like in CS11 , CS12 ( Urgent )
Hello all,
i have all the material and the components for the material in an internal table .
Now i am not getting the logic for getting the level number of the component.
Now i am having the data in an internal table as in CS11 ,with out the yellow record which represents the header of the components .
And i am using the funtion module 'CSAP_MAT_BOM_READ'
BOM Header Material 1111 has the components 1121 and 1122. These components are at level 1
Component 1121 is a BOM Header as well and contains the components 1311, 1312 and 1313. These components are at level 2.
Component 1313 is a BOM Header as well and contains the components 1141,
i am getting out put as
material component
1111 1121
1111 1122
1111 1311
1111 1312
1111 1313
1111 1141
along with this i want the level number ...
Can any one please help me on this .
Thanks and regards ,
PremUse function module CS_BOM_EXPL_MAT_V2, and in the import parameter set the MEHRS to 'X" 9 Set Multi level explosion to true.
Like this -
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
CAPID = C_CAPID
DATUV = P_DATUV
MTNRV = T_MAST-MATNR
STLAL = T_MAST-STLAL
STLAN = T_MAST-STLAN
WERKS = T_MAST-WERKS
MEHRS = 'X'
TABLES
STB = T_STB
EXCEPTIONS
ALT_NOT_FOUND = 1
CALL_INVALID = 2
MATERIAL_NOT_FOUND = 3
MISSING_AUTHORIZATION = 4
NO_BOM_FOUND = 5
NO_PLANT_DATA = 6
NO_SUITABLE_BOM_FOUND = 7
CONVERSION_ERROR = 8
OTHERS = 9. -
URGENT: Function modules or BAPIs
Hi Experts,
I need function modules or BAPI to get the open items and cleared items G/L Account wise.
Useful replies will be surely awarded.Hi Chakradhar,
Check tcode : BAPI
u will get all bapis there.
Regards,
Hemant -
How to attached class or function module in FD03
Hi Guys
I want to attached CL_ATTACHMENT_LIST for retriving attachment list from fd03 please help to attached the function module in my program?
regards
Piroz
report zfir_aged_debtors no standard page heading
line-size 255.
Type group
type-pools:
slis. " ALV types
Tables
tables:
adrc, " Addresses
bsad, " Accounting: Customer secondary index (Cleared)
bsid, " Accounting: Customer secondary index (Open)
kna1, " Customer master: General data
knkk, " Customer master: Credit management
knvk. " Customer master: Contact persons
Types
types:
begin of ty_bsadbsid,
bukrs like bsad-bukrs, " Company code
kunnr like bsad-kunnr, " Customer
gjahr like bsad-gjahr, " Fiscal year
belnr like bsad-belnr, " Accounting document number
buzei like bsad-buzei, " Line item
budat like bsad-budat, " Posting date
bldat like bsad-bldat, " Document date
waers like bsad-waers, " Currency
xblnr like bsad-xblnr, " Reference
shkzg like bsad-shkzg, " Debit/credit indicator
dmbtr like bsad-dmbtr, " Amount
zfbdt like bsad-zfbdt, " Baseline date for due date
" calculation
zbd1t like bsad-zbd1t, " Cash discount days 1
zbd2t like bsad-zbd2t, " Cash discount days 2
zbd3t like bsad-zbd3t, " Net payment terms period
rebzg like bsad-rebzg, " Number of the invoice
rebzt like bsad-rebzt, " Follow on document type
end of ty_bsadbsid,
ty_it_bsadbsid type ty_bsadbsid occurs 0,
begin of ty_merged,
kunnr like kna1-kunnr, " Customer number
name1 like adrc-name1, " Name
city1 like adrc-city1, " City
post_code1 like adrc-post_code1, " Post code
street like adrc-street, " Street
house_num1 like adrc-house_num1, " House number
tel_number like adrc-tel_number, " Telephone number
fax_number like adrc-fax_number, " Fax number
namev like knvk-namev, " First name
namew like knvk-name1, " Last name
telf1 like knvk-telf1, " Telephone number
klimk like knkk-klimk, " Credit limit
skfor like knkk-skfor, " Total receivables
total like bsad-dmbtr, " Total amount
rast1 like bsad-dmbtr, " Amount period 1
rast2 like bsad-dmbtr, " Amount period 2
rast3 like bsad-dmbtr, " Amount period 3
rast4 like bsad-dmbtr, " Amount period 4
rast5 like bsad-dmbtr, " Amount period 5
rast6 like bsad-dmbtr, " Amount period 6
end of ty_merged,
ty_it_merged type ty_merged occurs 0.
Internal tables
data:
Internal table to store customer line items from BSAD and BSID
it_bsadbsid type ty_it_bsadbsid,
Internal table to store field catalog for ALV function call
it_fieldcat type slis_t_fieldcat_alv,
Internal table to store summarised data for report output
it_merged type ty_it_merged.
Structures
data:
Display variant structures
st_tvariant like disvariant,
st_variant like disvariant.
Constants
constants:
co_delim_dash type c
value '-',
co_false type c " False
value space,
co_koart_d like faede-koart " Customer account type
value 'D',
co_save_u type c " User display variant
value 'U', " saving allowed.
co_shkzg_h like bsid-shkzg " Debit/Credit indicator
value 'H', " for credit
co_shkzg_s like bsid-shkzg " Debit/Credit indicator
value 'S', " for debit
co_selected type c " Value of selected radio
value 'X', " button or checkbox
co_true type c " True
value co_selected.
Variables
data:
va_exit type c.
Selection screen definition
selection-screen: begin of block b1 with frame title text-001.
select-options:
s_kunnr for bsad-kunnr. " Customer number
parameters:
p_kkber like knkk-kkber, " Credit control area
p_pafkt like knvk-pafkt, " Contact function
p_datum like sy-datum. " Report date
selection-screen: begin of line,
comment 01(30) text-006,
position pos_low.
parameters:
rastbis1 like rfpdo1-allgrogr " Due date sorted 1
default '000',
rastbis2 like rfpdo1-allgrogr " Due date sorted 2
default '000',
rastbis3 like rfpdo1-allgrogr " Due date sorted 3
default '000',
rastbis4 like rfpdo1-allgrogr " Due date sorted 4
default '000',
rastbis5 like rfpdo1-allgrogr " Due date sorted 5
default '000'.
selection-screen: end of line.
selection-screen: end of block b1,
begin of block b2 with frame title text-002.
parameters:
p_varint like disvariant-variant. " Display variant.
selection-screen: end of block b2.
Initialisation
initialization.
Provide default periods for due date sorted list.
rastbis1 = 0.
rastbis2 = 30.
rastbis3 = 60.
rastbis4 = 90.
rastbis5 = 120.
Default report date to current.
p_datum = sy-datlo.
Default credit control area to BP01.
p_kkber = 'BP01'.
At selection screen on value request for
at selection-screen on value-request for p_varint.
Provide display variant list for this program.
call function 'REUSE_ALV_VARIANT_F4'
exporting
is_variant = st_variant
i_save = co_save_u
importing
e_exit = va_exit
es_variant = st_tvariant
exceptions
not_found = 2.
if sy-subrc eq 2.
message id sy-msgid type 'S'
number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
if va_exit eq space.
st_variant = st_tvariant.
p_varint = st_tvariant-variant.
endif.
endif.
At selection screen
at selection-screen.
Load display variant.
if not p_varint is initial.
move st_variant to st_tvariant.
move p_varint to st_tvariant-variant.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = co_save_u
changing
cs_variant = st_tvariant.
st_variant = st_tvariant.
else.
clear st_variant.
st_variant-report = sy-repid.
endif.
if p_kkber is initial.
Ensure credit control area is specified.
message e000(zgen) with 'Credit control area must be specified'.
endif.
if p_pafkt is initial.
Ensure contact person function is specified.
message e000(zgen) with 'Contact person function must be specified'.
endif.
Start of selection
start-of-selection.
Extract open customer items from BSID
select bukrs kunnr gjahr belnr buzei budat bldat waers xblnr shkzg
dmbtr zfbdt zbd1t zbd2t zbd3t rebzg rebzt
from bsid
into table it_bsadbsid
where kunnr in s_kunnr
and budat le p_datum.
Extracct cleared customer items from BSAD
select bukrs kunnr gjahr belnr buzei budat bldat waers xblnr shkzg
dmbtr zfbdt zbd1t zbd2t zbd3t rebzg rebzt
from bsad
appending table it_bsadbsid
where kunnr in s_kunnr
and budat le p_datum
and augdt ge p_datum.
Ensure that items were not selected twice while getting data from the
open and cleared items tables (Only if transaction occured during
report run).
sort it_bsadbsid by bukrs belnr gjahr buzei.
delete adjacent duplicates from it_bsadbsid
comparing bukrs belnr gjahr buzei.
if it_bsadbsid[] is initial.
No data found for selection
message s001(zgen).
exit.
endif.
Merge data for report output
perform merge_data tables it_bsadbsid
it_merged.
Build field catalog
perform build_field_catalog tables it_fieldcat.
Output report via ALV
perform output_report_via_alv tables it_fieldcat
it_merged.
*& Form merge_data
text
form merge_data tables pa_it_bsadbsid type ty_it_bsadbsid
pa_it_merged type ty_it_merged.
Local work areas
data:
lwa_bsadbsid type ty_bsadbsid,
lwa_merged type ty_merged.
Local structures
data:
lst_faede like faede.
Local variables
data:
lva_daysover type i,
lva_merged_tabix like sy-tabix.
loop at pa_it_bsadbsid into lwa_bsadbsid.
Lookup merged entry for customer
clear lwa_merged.
read table pa_it_merged into lwa_merged
with key kunnr = lwa_bsadbsid-kunnr
binary search.
lva_merged_tabix = sy-tabix.
if sy-subrc ne 0.
Create new merged record for customer
lwa_merged-kunnr = lwa_bsadbsid-kunnr.
Get customer details from KNA1
clear kna1.
select single *
from kna1
where kunnr eq lwa_bsadbsid-kunnr.
Get customer address details from ADRC
clear adrc.
select single *
from adrc
where addrnumber eq kna1-adrnr
and date_from le p_datum.
lwa_merged-name1 = adrc-name1.
lwa_merged-city1 = adrc-city1.
lwa_merged-post_code1 = adrc-post_code1.
lwa_merged-street = adrc-street.
lwa_merged-house_num1 = adrc-house_num1.
lwa_merged-tel_number = adrc-tel_number.
lwa_merged-fax_number = adrc-fax_number.
Get credit limit details from KNKK
clear knkk.
select single *
from knkk
where kunnr eq lwa_bsadbsid-kunnr
and kkber eq p_kkber.
lwa_merged-klimk = knkk-klimk.
lwa_merged-skfor = knkk-skfor.
Get customer contact person details from KNVK
clear knvk.
select single *
from knvk
where kunnr eq lwa_bsadbsid-kunnr
and pafkt eq p_pafkt.
lwa_merged-namev = knvk-namev.
lwa_merged-namew = knvk-name1.
lwa_merged-telf1 = knvk-telf1.
insert lwa_merged into pa_it_merged index lva_merged_tabix.
endif.
Interpret debit/credit indicator
case lwa_bsadbsid-shkzg.
when co_shkzg_h.
Credit
lwa_bsadbsid-dmbtr = 0 - lwa_bsadbsid-dmbtr.
when co_shkzg_s.
Debit
endcase.
Perform ageing
clear lst_faede.
move-corresponding lwa_bsadbsid to lst_faede.
lst_faede-koart = co_koart_d.
call function 'DETERMINE_DUE_DATE'
exporting
i_faede = lst_faede
importing
e_faede = lst_faede
exceptions
others = 1.
lva_daysover = p_datum - lst_faede-netdt.
Accumulate total.
add lwa_bsadbsid-dmbtr to lwa_merged-total.
if lva_daysover le rastbis1.
add lwa_bsadbsid-dmbtr to lwa_merged-rast1.
else.
if lva_daysover le rastbis2 or
rastbis3 is initial.
add lwa_bsadbsid-dmbtr to lwa_merged-rast2.
else.
if lva_daysover le rastbis3 or
rastbis4 is initial.
add lwa_bsadbsid-dmbtr to lwa_merged-rast3.
else.
if lva_daysover le rastbis4 or
rastbis5 is initial.
add lwa_bsadbsid-dmbtr to lwa_merged-rast4.
else.
if lva_daysover le rastbis5.
add lwa_bsadbsid-dmbtr to lwa_merged-rast5.
else.
add lwa_bsadbsid-dmbtr to lwa_merged-rast6.
endif.
endif.
endif.
endif.
endif.
Update the merged record
modify pa_it_merged from lwa_merged index lva_merged_tabix.
endloop.
endform. " merge_data
*& Form build_field_catalog
text
form build_field_catalog tables pa_it_fieldcat type slis_t_fieldcat_alv.
Local work areas
data:
lwa_fieldcat type slis_fieldcat_alv.
--WG1K903216: Start Insert-
data: v_datum type datum,
v_mdmth type datum,
v_datxt type string,
v_noday type i.
--WG1K903216: End Insert---
refresh pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'KUNNR'.
lwa_fieldcat-ref_tabname = 'KNA1'.
lwa_fieldcat-ref_fieldname = 'KUNNR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '1'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'NAME1'.
lwa_fieldcat-ref_tabname = 'ADRC'.
lwa_fieldcat-ref_fieldname = 'NAME1'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '2'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'CITY1'.
lwa_fieldcat-ref_tabname = 'ADRC'.
lwa_fieldcat-ref_fieldname = 'CITY1'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '3'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'POST_CODE1'.
lwa_fieldcat-ref_tabname = 'ADRC'.
lwa_fieldcat-ref_fieldname = 'POST_CODE1'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '4'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'STREET'.
lwa_fieldcat-ref_tabname = 'ADRC'.
lwa_fieldcat-ref_fieldname = 'STREET'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '5'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'HOUSE_NUM1'.
lwa_fieldcat-ref_tabname = 'ADRC'.
lwa_fieldcat-ref_fieldname = 'HOUSE_NUM1'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '6'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'TEL_NUMBER'.
lwa_fieldcat-ref_tabname = 'ADRC'.
lwa_fieldcat-ref_fieldname = 'TEL_NUMBER'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '7'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'FAX_NUMBER'.
lwa_fieldcat-ref_tabname = 'ADRC'.
lwa_fieldcat-ref_fieldname = 'FAX_NUMBER'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '8'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'NAMEV'.
lwa_fieldcat-ref_tabname = 'KNVK'.
lwa_fieldcat-ref_fieldname = 'NAMEV'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '9'.
lwa_fieldcat-seltext_l = 'Contact first name'.
lwa_fieldcat-seltext_m = 'Contact Fname'.
lwa_fieldcat-seltext_s = 'Ctct Fname'.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'NAMEW'.
lwa_fieldcat-ref_tabname = 'KNVK'.
lwa_fieldcat-ref_fieldname = 'NAME1'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '10'.
lwa_fieldcat-seltext_l = 'Contact last name'.
lwa_fieldcat-seltext_m = 'Contact Lname'.
lwa_fieldcat-seltext_s = 'Ctxt Lname'.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'TELF1'.
lwa_fieldcat-ref_tabname = 'KNVK'.
lwa_fieldcat-ref_fieldname = 'TELF1'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '11'.
lwa_fieldcat-seltext_l = 'Contact phone no.'.
lwa_fieldcat-seltext_m = 'Contact phone'.
lwa_fieldcat-seltext_s = 'Ctct Phne'.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'KLIMK'.
lwa_fieldcat-ref_tabname = 'KNKK'.
lwa_fieldcat-ref_fieldname = 'KLIMK'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '12'.
lwa_fieldcat-seltext_l = 'Credit limit'.
lwa_fieldcat-seltext_m = 'Credit limit'.
lwa_fieldcat-seltext_s = 'Crdt limit'.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'SKFOR'.
lwa_fieldcat-ref_tabname = 'KNKK'.
lwa_fieldcat-ref_fieldname = 'SKFOR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '13'.
lwa_fieldcat-seltext_l = 'Credit used'.
lwa_fieldcat-seltext_m = 'Credit used'.
lwa_fieldcat-seltext_s = 'Crdt used'.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'TOTAL'.
lwa_fieldcat-ref_tabname = 'BSAD'.
lwa_fieldcat-ref_fieldname = 'DMBTR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '14'.
lwa_fieldcat-seltext_l = 'Total'.
lwa_fieldcat-seltext_m = 'Total'.
lwa_fieldcat-seltext_s = 'Total'.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'RAST1'.
lwa_fieldcat-ref_tabname = 'BSAD'.
lwa_fieldcat-ref_fieldname = 'DMBTR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '15'.
--WG1K903216: Start Delete-
concatenate '<'
rastbis2
into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Delete---
--WG1K903216: Start Insert-
clear: v_datum,
v_datxt.
v_noday = rastbis2.
Always use the middle of the report month as a heading reference date.
concatenate p_datum+0(6) '15' into v_mdmth.
call function 'ZWAG_DATE_CALCULATOR'
exporting i_datum = v_mdmth
i_noday = v_noday
i_oprnd = '+'
importing e_datum = v_datum
exceptions invalid_operand = 1.
call function 'ZWAG_END_MONTH'
exporting i_datum = v_datum
importing e_datum = v_datum
e_datxt = v_datxt
exceptions invalid_date = 1.
concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Insert---
lwa_fieldcat-seltext_m = lwa_fieldcat-seltext_l.
lwa_fieldcat-seltext_s = lwa_fieldcat-seltext_l.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'RAST2'.
lwa_fieldcat-ref_tabname = 'BSAD'.
lwa_fieldcat-ref_fieldname = 'DMBTR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '16'.
--WG1K903216: Start Delete-
concatenate rastbis1
rastbis2
into lwa_fieldcat-seltext_l
separated by co_delim_dash.
--WG1K903216: End Delete---
--WG1K903216: Start Insert-
clear: v_datum,
v_datxt.
v_noday = rastbis1.
call function 'ZWAG_DATE_CALCULATOR'
exporting i_datum = v_mdmth
i_noday = v_noday
i_oprnd = '+'
importing e_datum = v_datum
exceptions invalid_operand = 1.
call function 'ZWAG_END_MONTH'
exporting i_datum = v_datum
importing e_datum = v_datum
e_datxt = v_datxt
exceptions invalid_date = 1.
concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Insert---
lwa_fieldcat-seltext_m = lwa_fieldcat-seltext_l.
lwa_fieldcat-seltext_s = lwa_fieldcat-seltext_l.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'RAST3'.
lwa_fieldcat-ref_tabname = 'BSAD'.
lwa_fieldcat-ref_fieldname = 'DMBTR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '17'.
--WG1K903216: Start Delete-
concatenate rastbis2
rastbis3
into lwa_fieldcat-seltext_l
separated by co_delim_dash.
--WG1K903216: End Delete---
--WG1K903216: Start Insert-
clear: v_datum,
v_datxt.
v_noday = rastbis2.
call function 'ZWAG_DATE_CALCULATOR'
exporting i_datum = v_mdmth
i_noday = v_noday
i_oprnd = '-'
importing e_datum = v_datum
exceptions invalid_operand = 1.
call function 'ZWAG_END_MONTH'
exporting i_datum = v_datum
importing e_datum = v_datum
e_datxt = v_datxt
exceptions invalid_date = 1.
concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Insert---
lwa_fieldcat-seltext_m = lwa_fieldcat-seltext_l.
lwa_fieldcat-seltext_s = lwa_fieldcat-seltext_l.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'RAST4'.
lwa_fieldcat-ref_tabname = 'BSAD'.
lwa_fieldcat-ref_fieldname = 'DMBTR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '18'.
--WG1K903216: Start Delete-
concatenate rastbis3
rastbis4
into lwa_fieldcat-seltext_l
separated by co_delim_dash.
--WG1K903216: End Delete---
--WG1K903216: Start Insert-
clear: v_datum,
v_datxt.
v_noday = rastbis3.
call function 'ZWAG_DATE_CALCULATOR'
exporting i_datum = v_mdmth
i_noday = v_noday
i_oprnd = '-'
importing e_datum = v_datum
exceptions invalid_operand = 1.
call function 'ZWAG_END_MONTH'
exporting i_datum = v_datum
importing e_datum = v_datum
e_datxt = v_datxt
exceptions invalid_date = 1.
concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Insert---
lwa_fieldcat-seltext_m = lwa_fieldcat-seltext_l.
lwa_fieldcat-seltext_s = lwa_fieldcat-seltext_l.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'RAST5'.
lwa_fieldcat-ref_tabname = 'BSAD'.
lwa_fieldcat-ref_fieldname = 'DMBTR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '19'.
--WG1K903216: Start Delete-
concatenate rastbis4
rastbis5
into lwa_fieldcat-seltext_l
separated by co_delim_dash.
--WG1K903216: End Delete---
--WG1K903216: Start Insert-
clear: v_datum,
v_datxt.
v_noday = rastbis4.
call function 'ZWAG_DATE_CALCULATOR'
exporting i_datum = v_mdmth
i_noday = v_noday
i_oprnd = '-'
importing e_datum = v_datum
exceptions invalid_operand = 1.
call function 'ZWAG_END_MONTH'
exporting i_datum = v_datum
importing e_datum = v_datum
e_datxt = v_datxt
exceptions invalid_date = 1.
concatenate 'Due' v_datxt into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Insert---
lwa_fieldcat-seltext_m = lwa_fieldcat-seltext_l.
lwa_fieldcat-seltext_s = lwa_fieldcat-seltext_l.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
clear lwa_fieldcat.
lwa_fieldcat-tabname = 'PA_IT_MERGED'.
lwa_fieldcat-fieldname = 'RAST6'.
lwa_fieldcat-ref_tabname = 'BSAD'.
lwa_fieldcat-ref_fieldname = 'DMBTR'.
lwa_fieldcat-row_pos = '1'.
lwa_fieldcat-col_pos = '20'.
--WG1K903216: Start Delete-
concatenate '>'
rastbis5
into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Delete---
--WG1K903216: Start Insert-
clear: v_datum,
v_datxt.
v_noday = rastbis5.
call function 'ZWAG_DATE_CALCULATOR'
exporting i_datum = v_mdmth
i_noday = v_noday
i_oprnd = '-'
importing e_datum = v_datum
exceptions invalid_operand = 1.
call function 'ZWAG_END_MONTH'
exporting i_datum = v_datum
importing e_datum = v_datum
e_datxt = v_datxt
exceptions invalid_date = 1.
concatenate 'Due By' v_datxt into lwa_fieldcat-seltext_l
separated by space.
--WG1K903216: End Insert---
lwa_fieldcat-seltext_m = lwa_fieldcat-seltext_l.
lwa_fieldcat-seltext_s = lwa_fieldcat-seltext_l.
lwa_fieldcat-ddictxt = 'L'.
append lwa_fieldcat to pa_it_fieldcat.
endform. " build_field_catalog
*& Form output_report_via_alv
text
form output_report_via_alv
tables pa_it_fieldcat type slis_t_fieldcat_alv
pa_it_merged type ty_it_merged.
Local variables
data:
lva_repid like sy-repid,
lva_formname type slis_formname.
lva_repid = sy-repid.
lva_formname = 'USER_COMMAND'.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = lva_repid
i_callback_user_command = lva_formname
i_save = 'A'
is_variant = st_variant
it_fieldcat = pa_it_fieldcat[]
tables
t_outtab = pa_it_merged
exceptions
program_error = 1
others = 2.
endform. " output_report_via_alvHi shiva
Thanks for your help,
Can you check this coding and revert me back ASAP Please.
REPORT BDS_GOS_CONNECTION.
DATA : logical_system LIKE BAPIBDS01-log_system.
CLASSNAME LIKE BAPIBDS01-CLASSNAME
OBJKEY LIKE SWOTOBJID-objkey.
PARAMETERS: pa_lo_sys BAPIBDS01-log_system,
pa_class like BPIBDS01-CLASSNAME,
pa_objkey like swotobjidobjkey.
AT SELECTION-SCREEN.
CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
EXPORTING
bor_id = bor_id
IMPORTING
logical_sytem = pa_lo_sys.
classname = pa_class.
objkey = pa_objkey.
EXCEPTIONS
no_objects_found = 1
internal_error = 2
internal_gos_error = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
clear v_attno1.
i_object1-typeid = 'BUS2012'.
i_object1-catid = 'BO'.
i_object1-instid = i_yItem-docno.
call method cl_gos_attachment_query=>count_for_object
exporting
is_object = i_object1
ip_arl = space
receiving
rt_stat = i_stat1.
read table i_stat1 into wa_stat1 index 1.
if sy-subrc eq c_0.
move wa_stat1-counter to v_attno1.
endif.
CALL METHOD cl_gos_attachment_query=>count_for_object
EXPORTING
is_object = object
ip_arl = space
RECEIVING
rt_stat = lt_stat.
READ TABLE lt_stat INDEX 1 into ls_stat.
count = ls_stat-counter.
*The object has to be a concatenation of your document, like this:
CONCATENATE object-instid tab-gjahr INTO object-instid.
ELSE.
CONCATENATE tab-bukrs tab-belnr tab-gjahr INTO
object-instid.
ENDIF. -
Function Module to Release Scheduled Jobs
Dear All,
I have a requirement to create all the background jobs in SCHEDULED status, this is achieved by using the function modules JOB_OPEN, JOB_SUBMIT and JOB_CLOSE.
Now at a later point of time, i want to release only a few jobs, which were created using the above mentioned procedure. Insead of doing it manually, is there any way to automate this step ??
Regards,
kartikDear Mr. Parupalli,
That solved my problem. Thank you.
Regards,
kartik -
Call RFC Function Module and return 1000 records at a time
I would like to call a Remote Enabled Function Module from a non SAP system. This function module will select data from the database and return it to the calling program.
Suppose there are 100,000 records that need to be returned, but the calling module would like the data in chunks of 1000 records. Therefore the calling program would call the FM 100 times.
How do I code the function module to know on each subsequent call to grab the next chunk of 1000 records?
Let me know if additional information is needed.
Thanks,
AaronHello,
Here is how you can go for this issue:
1. Create one RFC function module with following parameter. These parameters are with respective of chunking logic.
Import: Package Size
Export: Total number of records
Changing: chunk count
Implement following logic:
1. First of you need to know how many chunks you need to fetch for that get the count of total number of records. This is one
time activity so you better maintain one flag import parameter will be set to 'X' only first call.
2. Get the number of chunk using total number of records / chunk size for e.g. 1000 / 100 so chunk count = 10.
3. Define internal chunk counter in function module which will be used to locate the correct chunk depending on the chunk
counter value sent from calling program.
4. Send first call with package size 100 and chunk count = 1, execute select statement and increment internal
chunk count check if chunk count = internal chunk count in current case chunk count = 1 so exit select statement and return
with first chunk.
5. Send second call with package size 100 and chunk count = 2. Execute select statement and check chunk count with internal
chunk counter, in current case it will be 1 so skip that data and go for next chunk of 100 records increment internal chunk
counter. In this case it will match with external chunk count = 2. load output table with that data and return to calling program.
6. Repeat step 4 until you reach last chunk.
You need to use SELECT...ENDSELECT with PACKAGE SIZE addition so for every loop it will return number of records mentioned in package size.
Hope this helps.
Thanks,
Augustin. -
Error while passing a table to a function module
Hi Iam passing a table g_tab of length 376 flat structure to the function module..under TABLES section parameter.
Changedocument_read_headers.
iam getting a complile time error like the below displayed thing. Can u tell me how to solve this ?
In the function module interface, you can specify only
fields of a specific type and length under "I_CDHDR".
Although the currently specified field
"G_CDHDR_TAB" is the correct type, its length is incorrect.
Edited by: kiran kumar on Jul 7, 2008 8:53 AMprobably u making a mistake while declaring the table
declare it like this in the tables section:
S_JOB LIKE RNGE_OBJID
where s_job is the internal table name and RANGE_OBJID is a structure type and NOT an internal table type. -
RFC Error While Invoking A Remote Function Module.
I am invoking A remote function module while invoking it get an exception when i see the error logs
com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Screen output without connection to user. , error key: RFC_ERROR_SYSTEM_FAILURE at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClassExecutable.execute(DynamicRFCModelClassExecutable.java:101) at... [see details]
can anyone pls tell me what the error is..
regards
Nilesh Taunk.Hi Nilesh Taunk,
You can go through the following steps
-o JCO Exceptions 1. http://help.sap.com/saphelp_nw04s/helpdata/en/f6/daea401675752ae10000000a155106/frameset.htm
-o JCO Exceptions 2. http://help.sap.com/saphelp_nw04/helpdata/en/f6/e002416225f023e10000000a155106/frameset.htm
-o Restart of the J2EE instance and try re-importing the RFC model. Sometimes it helps.
-o Logon into WebDynpro Content Administrator as a J2EE Admin and check if the JCO Connections and User /pwd of your application is correct. You can <b>ping </b>or <b>test your JCO connections</b>. if something is wrong, enter the values again for JCO n retest them.
-o Try undeploying or removing the complete application and redeploy it.
Tu undeploy please go to
Go to <b>Visual Admin -> Server -> Services -> Deploy ->
</b>
Under Runtime Tab
select the server, open the tree , you would find the webdypro list there.
Now select an application, first stop it, remove it and redeploy if necessary.
Let us know if you could solve the problem or not, gud luck!
Rgds,
Sreenivas. -
Error while generating Web Service from a function module.
Hi Experts,
I am trying to create a web service from function module by doing the steps as mentioned in the below document:
http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417800)ID1146834250DB10778842957931285337End?rid=/library/uuid/80fa3dff-ce76-2a10-3f94-f3df8f2db5a2&overridelayout=true
When i save it as an local object instead of generating the Web Service it gives me the below error:
"Error during activation of Web Service"
Kindly let me know what needs to be done inorder to resolve this issue.
I have a feeling that this error may be with respect to some authorizations, in that case how do we resolve it
Helpful Inputs Awaited.!!!
Thanks
DhwaniHi Dhawani,
Hi Pavan,
Can you please elaborate...how this will help??
Thanks
Dhwani
I dont know the specific reason but internally there may some inconsistancy but i faced the same error and i tried with saving it in the package.
Thanks -
CNTL_ERROR while calling a function module from Java webdynpro
I am calling a RFC function module from javawebdynpro app
which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
Any help on this is highly appreciatedGood catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
DATA:
SOURCEVAL TYPE /BIC/OIINVQTY,
SOURCEUOM TYPE /BIC/OIUSUOM,
USITM TYPE /BIC/OIUSITM,
TARGETUOM TYPE /BIC/OIUSUOM,
CONVERTED_COST TYPE /BIC/OIINVQTY.
DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
" get the Production UOM
SELECT SINGLE I~/BIC/USPRDUOM
FROM /BIC/PUSITM AS I
INTO PRODUCTION_UOM
WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
IF ( SY-SUBRC = 4 ). " no records found
"RAISE PARTNO_NOT_FOUND.
RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
ENDIF.
" load the parameters
SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
USITM = SOURCE_FIELDS-/BIC/USITM.
" then you can call the FM
CALL FUNCTION 'Z_CA_CONVERT_US_COST'
EXPORTING
PSOURCEVAL = SOURCEVAL
PSOURCEUOM = SOURCEUOM
PUSITM = USITM
PTARGETUOM = PRODUCTION_UOM
IMPORTING
PTARGETVAL = CONVERTED_COST
EXCEPTIONS
CONVERSION_NOT_MAINTAINED = 1
PARTNO_NOT_FOUND = 2
OTHERS = 3.
" ... [do the rest]
Thanks for your help,
Dennis -
Error in creation of function module in e.c.c 6.0
HI GURUS,
i encountered a problem while creating function module in e.c.c 6.0, the error is 'THE MAIN PROGRAM OF DOES NOT BEGIN WITH "FUNCTION-POOL". kindly help me in solving this issue.Hi,
You need to activate the Function Group.
GO to Se80 --> Select function group from list box --> press enter --> Select you function group > Right click> Activate.
Thanks,
Sriram Ponna.
Maybe you are looking for
-
The user does not exist or is not unique - workflow problem
I am using Solution Starters Dynamic Management workflow on my Project Server 2010. I was working fine for a year now, but today all workflows were broken when someone tried to submit them to a next stage. "Workflow terminated. An error has occurred
-
Tecra M3 - black and white dots
Im problem with My Tecra M3, I get the Toshiba logo come up fine. Then a bunch of black and white dots, (its windows when has crashed and gives you option in safe mode) but you cant make out any of the text, I only know this because Ive delt with com
-
Hi Experts, I have a customized P.O script which is now to be made for arabic language.i have excel sheet with me which is translation of english to arabic, 1. how can i proceed with the form in order to get exactly in arabic. 2. as arabic is read
-
Rename file name in photostream
question: how do i rename an image within photostream? note distinction: file name vs photo title. evidently photostream displays file name. hence, if you have gone to the trouble of renaming a photo title in photoshop and then created a photostream
-
How to Calculate Profitability Analysis ?
Hi kishore This is basically a part of Sales and Distribution Module . can u just revert me back with the Answer . Regards kishore