How to include income codes on 1042S reporting
I am configuring 1042 S processing. The different rates of withholding for treaty countries are being properly deducted.
My real question is: Do I need to have different withholding tax codes? I am using 42 with a tax wh type of 03. However, the payments my company is making are mostly for royalties ,income code 12, with a few payments for independent personal services,income code 16. I have tried adding a code for each income type, adding the formula for the tax code, etc. When I add more w/h tax codes, the w/h tax is not deducted. I can only get deductions for w/h with a tax code of 42.
Is there something that is going to show the income code on the form?
I would really appreciate any help with this issue.
Thanks
Alicia
Hi Alicia,
I am in the same boat as you were. I am trying to configure the 1042 S tax codes for my client and don't know how to do it. Do I need to create different tax codes like 12, 16, 42 or not and how the form picks up the codes and the amount. I don't have any configuration document. Any help would be appreciated.
Similar Messages
-
How to include source code in web dynpro java deployment
Hi,
We dont have NWDI.
We are creating ear files out of web dynpro applications packaging them as sca files and deploying them in server.
But the source code is not included in ear.
How to include source code with your ear/sca , so that when anyone downloads the sca file later, they are build the Project in the studio.
How would they typically download? Do they require NWDI ,
Right now we dont have NWDI in place, but we want to do is parcel the applications such that the source code should be available at a later time for download.
This is possible with .par files , but what about web dynpro?
Thanks,
DebIf you are not using NWDI use the _comp file.
-
How to check the code of spawned report
Hi All,
I've to modify a standard report from PA module.The report name is "PRC: Distribute Usage and Miscellaneous Costs"
The executable method is SPAWNED.The executable name is PASDUC.
Please let me know how to check the code of this report and in which path can I locate the report.
Regards,
Mahi.Does this mean can I tell to my client that "This is being a spawned program, any customizations to this report needs full report development efforts"?I believe yes.
Before I state this to my client I want to verify with this forum. Please suggest me in either case.Would your client trust my reply on here :) ?
I would suggest you log a SR and confirm this with Oracle support, that would be a better proof.
Thanks,
Hussein -
How to include Barcharts/graphs in alv report
Hi,
I need to create a graph with the help of ALV Grid control. I could able to activate the graphical option through clicking the 'GRAPH' icon in the ALV display.
But i am in need of changing the properties of graph(chart type / gridlines / chart options etc.,) display and also it have to be displayed automatically on executing the report. More than I need the graphical output in a single page with maximized window size.
Like Sub-Total / Sorting options are possible thru REUSE_ALV_GRID_DISPLAY i am in need of activating the Graph(chart) options automatically.
Thanks in AdvanceHi Subhakar,
Step by step procedure.
1) Create a PF status and call it, create a button for the Displaying Graph/Bar Chart.
2) In the main program include this code to handle cliking of your graph button.
3) Include the code like the below pseudo code.
data: begin of itab_graph occurs 0,
status_text(10) type c,
count1 type i,
count2 type i,
count3 type i,
end of itab_graph.
data: begin of i_graph_opt occurs 1,
c(80) type c,
end of i_graph_opt
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&DIS'.
write 'P2TYPE = PI' to i_graph_opt .append i_graph_opt.
write 'P2SCAL = X' to i_graph_opt .append i_graph_opt.
write 'P2PCNT = X' to i_graph_opt .append i_graph_opt.
write 'CLPALT = C' to i_graph_opt .append i_graph_opt.
write 'P3CTYP = CO' to i_graph_opt .append i_graph_opt.
write 'P3SCAL = X' to i_graph_opt .append i_graph_opt.
write 'P3LINS = X' to i_graph_opt .append i_graph_opt.
write 'TIFULL = X' to i_graph_opt .append i_graph_opt.
write 'TISIZE = 3' to i_graph_opt .append i_graph_opt.
write 'CLBACK = X' to i_graph_opt .append i_graph_opt.
" above few lines are options for setting the graph - customizing the view....
" Say P2TYPE = PI calls a Pie chart.
itab_graph-status_text = 'No of Jobs'.
itab_graph-count1 = count_1. "( may be ur totals and subtotals )
itab_graph-count2 = count_2.
itab_graph-count3 = count_3.
append itab_graph.
call function 'GRAPH_MATRIX_3D'
exporting
col1 = 'Text1'
col2 = 'Text2'
col3 = 'Text3
titl = 'Title of graph'
tables
data = itab_graph
opts = i_graph_opt.
clear itab_graph[].
endform.
Also refer function module documentatoon for complete understanding and usage.
Thanks,
Srinivas. -
How Can i hard code variable at reports in obiee 11g
Hi
I created as variable at rpd and using variable i am able to get expected results.
But i dont want to use variable directly , how can i hard code variable code at report and get same results.
Can anyone help me on this.
ThanksNot clear what you trying to achieve, try to go thru given info.
The statement 'select 1 from dual' in init blocks works using connection pool, but the same will not work in report since report understands Presentation Catalog objects.
In the report your query suppose to be like select 1 from Subject area where someColumn >0
If helps pls mark -
How to display BAR-CODE through ABAP report
Hi,
Could you please help me, how to display BAR-CODE through the ABAP report.
I am writing below code, but BAR-CODE is not displaying on report.
PRINT-CONTROL FUNCTION 'SBP01'.
WRITE: 20 BAR_CODE1 NO-GAP.
PRINT-CONTROL FUNCTION 'SBS01'.
Regards,
SSRAJU.Hi RAJU,
you can see this forum link and its sub-links, here it is clear about it.
Re: Barcode printing on report
Thanks & Regards,
Dileep .C -
How to include QR Code in to my RTF report
Hi All,
I need to insert QR Code( Quick Response code) into my xml report for some given data.
I do not have the ttf file of this QR code. Please let me know if any of you worked on this.
The process to get this ttf file and how to use it.
Thanks
Edited by: 834095 on Feb 22, 2011 9:24 PMBlog post on QR codes...
http://blogs.oracle.com/xmlpublisher/2010/03/google_gets_barcodey.html -
How to include maintaince view in da report
I did a report for Audit Inventory Ageing Company-wise Summary i am getting the output of the report well. what I need is that i should include a field WGBEZ of the maintaince view V023 so that to display material group description. where & how should i write the code in my code. kindly give suggestions. i here with attaching my code.
Title : Aged Stock
Description : 'Audit Inventory Ageing Company-wise Summary
REPORT ZMMR0024MOD LINE-SIZE 170 NO STANDARD PAGE HEADING .
TYPE-POOLS : SLIS.
TABLES : T001,
T023,
T001K,
MARA,
marv,
MAKT,
MBEW,
MSEG,
ekpo.
Constants
CONSTANTS : GC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE
'TOP_OF_PAGE'.
Internal Tables
DATA : BEGIN OF GT_FINAL OCCURS 0,
MATKL LIKE MARA-MATKL,
MATNR LIKE MARA-MATNR,
WGBEZ LIKE V023-WGBEZ,
LBKUM LIKE MBEW-LBKUM,
tot_val type p decimals 2,
MAKTX LIKE MAKT-MAKTX,
tot_amt type p decimals 2,
price type p decimals 2,
meins like mara-meins,
END OF GT_FINAL,
DETAIL_FINAL LIKE GT_FINAL OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF MAT_FINAL OCCURS 0,
MATKL LIKE MARA-MATKL,
TOT_VAL LIKE MSEG-MENGE,
TOT_AMT LIKE MBEW-SALK3,
PRICE LIKE MBEW-SALK3,
meins like mara-meins,
END OF MAT_FINAL.
DATA : BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
MAKTX LIKE MAKT-MAKTX,
WGBEZ LIKE V023-WGBEZ,
MEINS LIKE MARA-MEINS,
LBKUM LIKE MBEWH-LBKUM,
TOT_AMT LIKE MBEW-SALK3,
END OF I_MARA.
DATA : BEGIN OF I_MKPF_MSEG OCCURS 0,
MATNR LIKE MARA-MATNR,
MBLNR LIKE MSEG-MBLNR,
ZEILE LIKE MSEG-ZEILE,
MENGE LIKE MSEG-MENGE,
BWART LIKE MSEG-BWART,
BUDAT LIKE MKPF-BUDAT,
NET_VAL LIKE MSEG-MENGE,
ebeln like mseg-ebeln,
ebelp like mseg-ebelp,
lfbnr like mseg-lfbnr,
lfpos like mseg-lfpos,
SHKZG LIKE MSEG-SHKZG,
meins like mara-meins,
END OF I_MKPF_MSEG,
WA_TEMP LIKE I_MKPF_MSEG.
DATA : BEGIN OF I_MBEWH OCCURS 0,
MATNR LIKE MARA-MATNR,
LBKUM LIKE MBEW-LBKUM,
SALK3 LIKE MBEW-SALK3,
BWKEY LIKE MBEW-BWKEY,
END OF I_MBEWH.
DATA : I_MBEWH1 LIKE I_MBEWH OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF I_TEMP OCCURS 0,
MATNR LIKE MARA-MATNR,
NET_VAL LIKE MSEG-MENGE,
meins like mara-meins,
END OF I_TEMP.
RANGES : RANGE_WERK FOR T001W-WERKS,
RANGE_DATE FOR SY-DATUM,
S_BWTAR FOR BWTAR.
DATA : PERIOD LIKE BAPI0002_4-FISCAL_PERIOD,
FISCAL_YEAR LIKE BAPI0002_4-FISCAL_YEAR,
CUR_VAL LIKE MSEG-MENGE,
NET_VAL LIKE MSEG-MENGE,
TOT_VAL LIKE MSEG-MENGE,
TOT_QTY LIKE MSEG-MENGE,
TOT_AMT1 LIKE MBEW-SALK3,
RES_DATE LIKE SY-DATUM,
NUM LIKE MBEW-SALK3,
UOM LIKE MARA-MEINS.
Data declarations for alv
DATA : GV_PAGE TYPE N VALUE 0.
DATA : GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GT_FILTER TYPE SLIS_T_FILTER_ALV,
GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GT_EVENTS TYPE SLIS_T_EVENT WITH HEADER LINE,
GV_REPID LIKE SY-REPID,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GV_SAVE(1) TYPE C,
GT_VARIANT LIKE DISVARIANT,
GV_DOMNAME LIKE DD07V-DOMNAME,
GV_DOMVAL LIKE DD07V-DOMVALUE_L,
GW_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
Selection screen
SELECTION-SCREEN BEGIN OF BLOCK SEL WITH FRAME TITLE TEXT-001.
PARAMETERS : GS_BUKRS LIKE T001K-BUKRS OBLIGATORY.
SELECT-OPTIONS : GS_MATKL FOR MARA-MATKL,
GS_MATNR FOR MARA-MATNR.
PARAMETERS : gs_ped like s031-spmon OBLIGATORY,
GS_DAYS(3) TYPE n,
MG1 RADIOBUTTON GROUP GR1,
MT2 RADIOBUTTON GROUP GR1.
SELECTION-SCREEN END OF BLOCK SEL.
Validations on selection screen
AT SELECTION-SCREEN ON GS_BUKRS.
PERFORM F00_VALIDATE_COMPANY_CODE.
AT SELECTION-SCREEN ON GS_MATKL.
IF NOT GS_MATKL[] IS INITIAL.
PERFORM F01_VALIDATE_MATERIAL_GROUP.
ENDIF.
AT SELECTION-SCREEN ON GS_MATNR.
IF NOT GS_MATNR[] IS INITIAL.
PERFORM F01_VALIDATE_MATERIAL.
ENDIF.
AT SELECTION-SCREEN ON GS_days.
if gs_days = ''.
gs_days = 0.
endif.
START-OF-SELECTION.
GV_REPID = SY-REPID.
PERFORM F20_EVENTTAB_BUILD CHANGING GT_EVENTS[].
PERFORM F30_SELECT_PRIMARY_DATA.
IF MG1 = 'X'.
PERFORM F11_DATA_FORMAT_GROUP.
PERFORM F50_MATERIAL_GROUP_DATA.
PERFORM F40_DISPLAY_REPORT TABLES MAT_FINAL.
ELSEIF MT2 = 'X'.
PERFORM F10_DATA_FORMAT_MAT.
PERFORM F40_DISPLAY_REPORT TABLES GT_FINAL.
ENDIF.
*& Form F20_EVENTTAB_BUILD
FORM F20_EVENTTAB_BUILD CHANGING LT_EVENTS TYPE SLIS_T_EVENT.
CONSTANTS: LC_FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE
'TOP_OF_PAGE',
LC_FORMNAME_USER_COMMAND TYPE SLIS_FORMNAME VALUE
'USER_COMMAND'.
DATA: LS_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = LT_EVENTS.
note : lt_events has all the events
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE GC_FORMNAME_TOP_OF_PAGE TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE LC_FORMNAME_USER_COMMAND TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
ENDFORM. "F20_EVENTTAB_BUILD
*& Form F12_E04_COMMENT_BUILD
FORM F12_E04_COMMENT_BUILD USING E04_LT_TOP_OF_PAGE TYPE
SLIS_T_LISTHEADER.
DATA : LS_LINE TYPE SLIS_LISTHEADER,
LV_TEXT(100) TYPE C,
LV_DAYLOW(2) TYPE C,
LV_MONTHLOW(2) TYPE C,
LV_YEARHIGH(4) TYPE C,
LV_DAYHIGH(2) TYPE C,
LV_MONTHHIGH(2) TYPE C,
LV_YEARLOW(4) TYPE C,
LV_DATFORMAT1(10),
LV_DATFORMAT2(10).
CONCATENATE 'Company Code :' ' ' GS_BUKRS
INTO LV_TEXT SEPARATED BY SPACE.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
CLEAR LV_TEXT.
IF NOT GS_MATKL[] IS INITIAL.
IF GS_MATKL-HIGH IS INITIAL AND NOT GS_MATKL-LOW IS INITIAL.
CONCATENATE 'Material Group :' ' ' GS_MATKL-LOW
INTO LV_TEXT SEPARATED BY SPACE.
ELSE .
CONCATENATE 'Material Group :' GS_MATKL-LOW ' to'
GS_MATKL-HIGH INTO LV_TEXT SEPARATED BY SPACE.
ENDIF.
ENDIF.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
CLEAR LV_TEXT.
IF NOT GS_MATNR[] IS INITIAL.
IF GS_MATNR-HIGH IS INITIAL AND NOT GS_MATNR-LOW IS INITIAL.
CONCATENATE 'Material :' ' ' GS_MATNR-LOW
INTO LV_TEXT SEPARATED BY SPACE.
ELSE .
CONCATENATE 'Material :' GS_MATNR-LOW ' to'
GS_MATNR-HIGH INTO LV_TEXT SEPARATED BY SPACE.
ENDIF.
ENDIF.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
CLEAR LV_TEXT.
LV_YEARLOW = gs_ped+0(4).
LV_MONTHLOW = gs_ped+4(2).
LV_DAYLOW = gs_ped+6(2).
CONCATENATE LV_DAYLOW LV_MONTHLOW LV_YEARLOW INTO LV_DATFORMAT1
*SEPARATED BY '.'.
CONCATENATE 'Key month : ' gs_ped
INTO LV_TEXT SEPARATED BY SPACE.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
CLEAR LV_TEXT.
CONCATENATE 'Number of days :' ' ' GS_DAYS
INTO LV_TEXT SEPARATED BY SPACE.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
CLEAR LV_TEXT.
GV_PAGE = GV_PAGE + 1.
CONCATENATE 'PAGE NO : ' ' ' GV_PAGE
INTO LV_TEXT SEPARATED BY SPACE.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = LV_TEXT.
APPEND LS_LINE TO E04_LT_TOP_OF_PAGE.
ENDFORM. "F12_E04_COMMENT_BUILD
FORM TOP_OF_PAGE *
FORM TOP_OF_PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.
ENDFORM. "TOP_OF_PAGE
*& Form validate_sales_organization
text
FORM F00_VALIDATE_COMPANY_CODE .
SELECT SINGLE BUKRS
FROM T001
INTO T001-BUKRS
WHERE BUKRS = GS_BUKRS.
IF SY-SUBRC = 0.
ELSE.
MESSAGE E000(ZCBOM) WITH 'Please enter the valid material group'.
ENDIF.
ENDFORM. " validate_sales_organization
*& Form VALIDATE_PLANT
text
--> p1 text
<-- p2 text
FORM F01_VALIDATE_MATERIAL_GROUP.
SELECT SINGLE MATKL
FROM T023
INTO T023-MATKL
WHERE MATKL IN GS_MATKL.
IF SY-SUBRC = 0.
ELSE.
MESSAGE E000(ZCBOM) WITH 'Please enter the valid material group'.
ENDIF.
ENDFORM. " VALIDATE_PLANT
*& Form VALIDATE_MATERIAL
text
--> p1 text
<-- p2 text
FORM F01_VALIDATE_MATERIAL.
SELECT SINGLE MATNR
FROM MARA
INTO MARA-MATNR
WHERE MATNR IN GS_MATNR.
IF SY-SUBRC = 0.
ELSE.
MESSAGE E000(ZCBOM) WITH 'Please enter the valid material '.
ENDIF.
ENDFORM. " VALIDATE_MATERIAL
*& Form F40_DISPLAY_REPORT
FORM F40_DISPLAY_REPORT TABLES IT.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GV_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND '
IT_FIELDCAT = GT_FIELDCAT[]
IT_SPECIAL_GROUPS = GT_SP_GROUP[]
IT_SORT = GT_SORT[]
I_SAVE = GV_SAVE
IS_VARIANT = GT_VARIANT
IT_EVENTS = GT_EVENTS[]
TABLES
T_OUTTAB = IT. "it_1.
CLEAR:GT_FIELDCAT.
REFRESH:GT_FIELDCAT.
ENDFORM. " F40_DISPLAY_REPORT
*& Form F30_SELECT_PRIMARY_DATA
text
FORM F30_SELECT_PRIMARY_DATA .
subroutine to get the actual data
to get the plants for the given company code
data : temp_bukrs like BAPI0002_2-COMP_CODE,
temp_date like BAPI0002_4-POSTING_DATE.
data : last_day(2) type n,
from_date like sy-datum,
temp_date1 like sy-datum,
cal_month(2) type n,
cal_year(4) type n.
SELECT DISTINCT BWKEY FROM T001K INTO RANGE_WERK-LOW WHERE BUKRS = GS_BUKRS.
RANGE_WERK-SIGN = 'I'.
RANGE_WERK-OPTION = 'EQ'.
APPEND RANGE_WERK.
ENDSELECT.
*selecting material that is relevant to the selection criteria
SELECT MARA~MATNR MATKL MEINS MAKTX
FROM MARA JOIN MAKT
ON MAKTMATNR = MARAMATNR
INTO CORRESPONDING FIELDS OF TABLE I_MARA
WHERE MARA~MATNR IN GS_MATNR
AND MATKL IN GS_MATKL
AND MAKT~SPRAS = 'EN'.
temp_bukrs = gs_bukrs.
cal_month = gs_ped+4(2).
cal_year = gs_ped+0(4).
concatenate cal_year cal_month '01' into temp_date.
*temp_date = temp_date1.
CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
EXPORTING
COMPANYCODEID = temp_bukrs
POSTING_DATE = temp_date
IMPORTING
FISCAL_YEAR = fiscal_year
FISCAL_PERIOD = period.
select single * from marv into marv where bukrs = temp_bukrs.
temp_date1 = temp_date.
if sy-subrc = 0.
if ( marv-lfmon ne period or marv-lfgja ne fiscal_year ).
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = temp_date
IMPORTING
LAST_DAY_OF_MONTH = from_date
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2.
else.
from_date = sy-datum.
endif.
endif.
to define the range for posting date
RES_DATE = from_date - GS_DAYS.
RANGE_DATE-LOW = RES_DATE.
RANGE_DATE-HIGH = from_date.
RANGE_DATE-OPTION = 'BT'.
RANGE_DATE-SIGN = 'I'.
APPEND RANGE_DATE.
to select documents and their quantities for the given range of posting dates
with goods movement type 101 105 657 453 459 501 521 and their reversals
if range_date-low ne range_date-high.
SELECT MSEG~MATNR MSEG~MBLNR MSEG~ZEILE MSEG~MENGE MSEG~BWART mseg~ebeln mseg~ebelp
MKPF~BUDAT MSEG~SHKZG
FROM MKPF
JOIN MSEG ON MSEG~MBLNR = MKPF~MBLNR
AND MSEG~MJAHR = MKPF~MJAHR
INTO CORRESPONDING FIELDS OF TABLE I_MKPF_MSEG
FOR ALL ENTRIES IN I_MARA
WHERE MSEG~MATNR = I_MARA-MATNR
AND MSEG~WERKS IN RANGE_WERK
AND MKPF~BUDAT IN RANGE_DATE
AND MSEG~BWART IN ('101','105','657','453','459','501','521','561','309','701','712', "711
'102','106','658','454','460','502','522','562').
DELETE I_MKPF_MSEG WHERE ( BWART = '309' AND SHKZG = 'H')
or ( bwart = '453' and shkzg = 'H')
or ( bwart = '454' and shkzg = 'S').
endif.
SORT I_MKPF_MSEG BY MATNR MBLNR.
LOOP AT I_MKPF_MSEG.
if i_mkpf_mseg-bwart = '101' or i_mkpf_mseg-bwart = '102'.
select single * from ekpo where ebeln = i_mkpf_mseg-ebeln
and ebelp = i_mkpf_mseg-ebelp.
if ekpo-pstyp = 7.
delete i_mkpf_mseg where ebeln = i_mkpf_mseg-ebeln
and ebelp = i_mkpf_mseg-ebelp.
CLEAR I_MKPF_MSEG-MENGE.
endif.
endif.
IF ( I_MKPF_MSEG-BWART = '101' OR I_MKPF_MSEG-BWART = '105' OR I_MKPF_MSEG-BWART = '712' OR
I_MKPF_MSEG-BWART = '657' OR I_MKPF_MSEG-BWART = '453' OR "I_MKPF_MSEG-BWART = '711' OR
I_MKPF_MSEG-BWART = '459' OR I_MKPF_MSEG-BWART = '501' OR I_MKPF_MSEG-BWART = '701' OR
I_MKPF_MSEG-BWART = '521' OR I_MKPF_MSEG-BWART = '561' OR I_MKPF_MSEG-BWART = '309').
NET_VAL = NET_VAL + I_MKPF_MSEG-MENGE.
ENDIF.
IF ( I_MKPF_MSEG-BWART = '102' OR I_MKPF_MSEG-BWART = '106' OR
I_MKPF_MSEG-BWART = '658' OR I_MKPF_MSEG-BWART = '454' OR
I_MKPF_MSEG-BWART = '460' OR I_MKPF_MSEG-BWART = '502' OR
I_MKPF_MSEG-BWART = '522' OR I_MKPF_MSEG-BWART = '562').
NET_VAL = NET_VAL - I_MKPF_MSEG-MENGE.
ENDIF.
WA_TEMP = I_MKPF_MSEG.
AT END OF MATNR.
I_TEMP-MATNR = WA_TEMP-MATNR.
I_TEMP-NET_VAL = NET_VAL.
APPEND I_TEMP.
CLEAR NET_VAL.
ENDAT.
ENDLOOP.
SORT I_MARA BY MATNR.
SORT I_TEMP BY MATNR.
SELECT MATNR LBKUM SALK3 BWKEY
FROM MBEWH
INTO CORRESPONDING FIELDS OF TABLE I_MBEWH
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND BWKEY IN RANGE_WERK
AND BWTAR IN S_BWTAR
AND LFGJA = FISCAL_YEAR
AND LFMON = PERIOD.
SELECT MATNR LBKUM SALK3 BWKEY
FROM MBEW
INTO CORRESPONDING FIELDS OF TABLE I_MBEWH1
FOR ALL ENTRIES IN I_MARA
WHERE MATNR = I_MARA-MATNR
AND BWKEY IN RANGE_WERK.
AND LFMON = PERIOD
AND LFGJA = FISCAL_YEAR.
SORT I_MBEWH BY MATNR BWKEY.
SORT I_MBEWH1 BY MATNR BWKEY.
LOOP AT I_MBEWH.
LOOP AT I_MBEWH1 WHERE MATNR = I_MBEWH-MATNR
AND BWKEY = I_MBEWH-BWKEY.
DELETE I_MBEWH1.
ENDLOOP.
ENDLOOP.
APPEND LINES OF I_MBEWH1 TO I_MBEWH.
CLEAR : I_MBEWH1.
REFRESH I_MBEWH1.
SORT I_MBEWH BY MATNR.
LOOP AT I_MBEWH .
I_MBEWH1 = I_MBEWH.
AT END OF MATNR.
SUM.
I_MBEWH1-LBKUM = I_MBEWH-LBKUM.
I_MBEWH1-SALK3 = I_MBEWH-SALK3.
APPEND I_MBEWH1.
ENDAT.
ENDLOOP.
DELETE I_MBEWH1 WHERE LBKUM <= 0.
LOOP AT I_MARA.
CLEAR : CUR_VAL,
NUM,
TOT_VAL,
TOT_AMT1,
I_MBEWH1.
GT_FINAL-MATNR = I_MARA-MATNR.
GT_FINAL-MATKL = I_MARA-MATKL.
GT_FINAL-MAKTX = I_MARA-MAKTX.
gt_final-meins = I_MARA-MEINS.
READ TABLE I_MBEWH1 WITH KEY MATNR = I_MARA-MATNR.
GT_FINAL-LBKUM = I_MBEWH1-LBKUM.
to get the net inward movement vale that is to be subtracted from current value
READ TABLE I_TEMP WITH KEY MATNR = I_MARA-MATNR.
IF SY-SUBRC = 0 .
IF GT_FINAL-LBKUM > 0.
TOT_VAL = gt_final-lbkum - I_TEMP-NET_VAL.
if tot_val gt 0.
GT_FINAL-TOT_VAL = TOT_VAL.
GT_FINAL-PRICE = I_MBEWH1-SALK3 / gt_final-lbkum."TOT_VAL.
GT_FINAL-TOT_AMT = GT_FINAL-PRICE * GT_FINAL-TOT_VAL.
APPEND GT_FINAL.
endif.
ENDIF.
else.
if gt_final-lbkum > 0.
gt_final-tot_val = gt_final-lbkum.
GT_FINAL-PRICE = I_MBEWH1-SALK3 / gt_final-lbkum.
GT_FINAL-TOT_AMT = GT_FINAL-PRICE * GT_FINAL-TOT_VAL.
APPEND GT_FINAL.
endif.
ENDIF.
ENDLOOP.
DELETE GT_FINAL WHERE LBKUM LE 0.
ENDFORM. " F30_SELECT_PRIMARY_DATA
*& Form f10_DATA_FORMAT
text
FORM F10_DATA_FORMAT_MAT .
populating the field catalog table
MATNR
PERFORM F11_E01_FIELDCAT_INIT USING 'MARA' 'MATNR' 'MATNR' '1'
TEXT-003 'GT_FINAL' '15'.
MAKTX
PERFORM F11_E01_FIELDCAT_INIT USING 'MARA' 'MATKL' 'MATKL' '2'
TEXT-004 'GT_FINAL' '24'.
DESC
PERFORM F11_E01_FIELDCAT_INIT USING 'MAKT' 'MAKTX' 'MAKTX' '3'
TEXT-005 'GT_FINAL' '35'.
Material Group Decription
PERFORM F11_E01_FIELDCAT_INIT USING 'V023' 'WGBEZ' 'WGBEZ' '3'
TEXT-005 'GT_FINAL' '20'.
qty
PERFORM F11_E01_FIELDCAT_INIT USING '' 'TOT_VAL' 'MENGE' '4'
TEXT-006 'GT_FINAL' '15'.
MEINS
PERFORM F11_E01_FIELDCAT_INIT USING '' 'MEINS' 'MEINS' '4'
TEXT-008 'GT_FINAL' '15'.
TOTAL COST
PERFORM F11_E01_FIELDCAT_INIT USING '' 'TOT_AMT' 'SALK3' '5'
TEXT-007 'GT_FINAL' '24'.
PERFORM F12_E04_COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
GV_SAVE = 'A'.
CLEAR GT_EVENTS.
REFRESH GT_EVENTS.
GT_EVENTS-NAME = 'TOP_OF_PAGE'.
GT_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND GT_EVENTS.
ENDFORM. " f10_DATA_FORMAT
*& Form F11_E01_FIELDCAT_INIT
text
FORM F11_E01_FIELDCAT_INIT USING T1 T2 T3 T4 T5 T6 T7.
CLEAR GW_FIELDCAT.
GW_FIELDCAT-REF_TABNAME = T1.
GW_FIELDCAT-FIELDNAME = T2.
GW_FIELDCAT-REF_FIELDNAME = T3.
GW_FIELDCAT-COL_POS = T4.
GW_FIELDCAT-SELTEXT_L = T5.
GW_FIELDCAT-TABNAME = T6.
GW_FIELDCAT-OUTPUTLEN = T7.
APPEND GW_FIELDCAT TO GT_FIELDCAT.
ENDFORM. " F11_E01_FIELDCAT_INIT
*& Form f40_material_group_data
text
--> p1 text
<-- p2 text
FORM F50_MATERIAL_GROUP_DATA .
SORT GT_FINAL BY MATKL.
LOOP AT GT_FINAL.
TOT_QTY = GT_FINAL-TOT_VAL + TOT_QTY.
TOT_AMT1 = GT_FINAL-TOT_AMT + TOT_AMT1.
UOM = GT_FINAL-MEINS.
AT END OF MATKL.
MAT_FINAL-MATKL = GT_FINAL-MATKL.
MAT_FINAL-TOT_VAL = TOT_QTY.
MAT_FINAL-TOT_AMT = TOT_AMT1.
MAT_FINAL-MEINS = UOM.
APPEND MAT_FINAL.
CLEAR : TOT_QTY,
TOT_AMT1.
ENDAT.
ENDLOOP.
ENDFORM. " f40_material_group_data
*& Form BUILD_DETAIL
text
--> p1 text
<-- p2 text
FORM BUILD_DETAIL .
DETAIL_FINAL[] = GT_FINAL[].
DELETE DETAIL_FINAL WHERE MATKL NE MAT_FINAL-MATKL.
ENDFORM. " BUILD_DETAIL
*& Form f11_data_format_group
text
--> p1 text
<-- p2 text
FORM F11_DATA_FORMAT_GROUP .
MATNR
PERFORM F11_E01_FIELDCAT_INIT USING 'MARA' 'MATNR' 'MATNR' '1'
TEXT-003 'GT_FINAL' '15'.
REFRESH GT_FIELDCAT[].
MAKTX
PERFORM F11_E01_FIELDCAT_INIT USING 'MARA' 'MATKL' 'MATKL' '2'
TEXT-004 'MAT_FINAL' '24'.
DESC
PERFORM F11_E01_FIELDCAT_INIT USING 'MAKT' 'MAKTX' 'MAKTX' '3'
TEXT-005 'GT_FINAL' '35'.
Material Group Decription
PERFORM F11_E01_FIELDCAT_INIT USING 'V023' 'WGBEZ' 'WGBEZ' '3'
TEXT-005 'GT_FINAL' '20'.
qty
PERFORM F11_E01_FIELDCAT_INIT USING '' 'TOT_VAL' 'MENGE' '4'
TEXT-006 'MAT_FINAL' '15'.
qty
PERFORM F11_E01_FIELDCAT_INIT USING '' 'MEINS' 'MEINS' '5'
TEXT-008 'MAT_FINAL' '15'.
TOTAL COST
PERFORM F11_E01_FIELDCAT_INIT USING '' 'TOT_AMT' 'SALK3' '6'
TEXT-007 'MAT_FINAL' '24'.
PERFORM F12_E04_COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
GV_SAVE = 'A'.
CLEAR GT_EVENTS.
REFRESH GT_EVENTS.
GT_EVENTS-NAME = 'TOP_OF_PAGE'.
GT_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND GT_EVENTS.
ENDFORM. " f11_data_format_group
*& Form DETAIL_FORMAT_FIELDCAT
text
--> p1 text
<-- p2 text
FORM DETAIL_FORMAT_FIELDCAT .
REFRESH GT_FIELDCAT[].
MATNR
PERFORM F11_E01_FIELDCAT_INIT USING 'MARA' 'MATNR' 'MATNR' '1'
TEXT-003 'DETAIL_FINAL' '15'.
MAKTL
PERFORM F11_E01_FIELDCAT_INIT USING 'MARA' 'MATKL' 'MATKL' '2'
TEXT-004 'DETAIL_FINAL' '24'.
MAKTX
PERFORM F11_E01_FIELDCAT_INIT USING 'MAKT' 'MAKTX' 'MAKTX' '3'
TEXT-005 'DETAIL_FINAL' '35'.
qty
PERFORM F11_E01_FIELDCAT_INIT USING '' 'TOT_VAL' 'MENGE' '4'
TEXT-006 'DETAIL_FINAL' '15'.
UOM
PERFORM F11_E01_FIELDCAT_INIT USING '' 'MEINS' 'MEINS' '5'
TEXT-008 'DETAIL_FINAL' '15'.
TOTAL COST
PERFORM F11_E01_FIELDCAT_INIT USING '' 'TOT_AMT' 'SALK3' '6'
TEXT-007 'DETAIL_FINAL' '24'.
PERFORM F12_E04_COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
GV_SAVE = 'A'.
CLEAR GT_EVENTS.
REFRESH GT_EVENTS.
GT_EVENTS-NAME = 'TOP_OF_PAGE'.
GT_EVENTS-FORM = 'TOP_OF_PAGE'.
APPEND GT_EVENTS.
ENDFORM. " DETAIL_FORMAT_FIELDCAT
FORM USER_COMMAND *
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'. "doubleclick
IF RS_SELFIELD-TABNAME = 'MAT_FINAL'.
READ TABLE MAT_FINAL INDEX RS_SELFIELD-TABINDEX .
PERFORM BUILD_DETAIL.
PERFORM DETAIL_FORMAT_FIELDCAT.
PERFORM F20_EVENTTAB_BUILD CHANGING GT_EVENTS[].
PERFORM F40_DISPLAY_REPORT TABLES DETAIL_FINAL.
CLEAR DETAIL_FINAL[].
ENDIF.
CLEAR R_UCOMM.
ENDCASE.
ENDFORM. "USER_COMMANDHi,
Done with the help of abaper.
Thanks & Regards,
Sandeep -
How to Create Transaction code for a Report
Hi Gurus,
I created some reports and I wants those reports
should be placed in the SAP Menu(initial screen) not
in the User menu in the form of Transaction codes.
I would really appreciate if any one can please send the process to create transaction codes for the User reports/Report groups in R/3 and how to add those created Transaction codes to the SAP MENU.
Thanks in Advance
DanialTry to insert it into the main menu if you must change S000 (there is a function module for everything)? Perhaps SAP protects their menu trees from foreign subnodes in SE43?
Also note that for report transactions you do not need to give the user transaction code start_report. If you do, then they could enter it directly and potentially start many other reports too. The system will call start_report for submitting the report internally without authorizations for it required (unless start_report is maintained in SE97).
Regarding DE, this also confuses me sometimes and I noticed that it generally indicates that I am doing something which has an implication for a SAP standard object. Try either hitting the enter button to see what the next screen is, or, choose original language in the previous screen, or, logon in sy-langu = DE and (remember the path if you dont speak German) change it, or, follow JCs advice to create your own menu. -
How to generate Income Statement from Crystal Report
Hi, Experts,
I have:
SAP BUSINESS ONE 2007A
CRYSTAL REPORT 2008
I have a problem with generating Income Statement related reports from CRYSTAL.
For example,
My revenue accounts are: '411000-00-00' and '412000-00-00', my expense accounts are: '510000-00-00' and '520000-00-00'.
I'd like to generate the Income statement for Dec 1 - 31, 2008. Please advise how to generate this report. Thanks!
LorrieHi, Experts,
Currently, what I tested to generate the income statement is:
1. find out the account detail table: JDT1. My database path: Company Name -> dbo -> Tables -> JDT1
2. follow the standard report menu: add 'JDT1', show 'RefDate', 'ContraAct'; group by'Account', summarize by 'Account'.
I have the following problems:
1. with this method, I am not able to find the amount for each transaction. Because the amount does not have a name as 'RefDate' or some other fields.
2. the 'Account' and 'ContraAct' are all shown as 'SYS00000001685'. It's sysmtem message but not the actual account number or contra account number.
Thanks!
Lorrie -
How to use bdc code in a report for save button
hi to all can anybody please give some hints that how can i place the BDC code for the save button to pass the values from the editable grid to the standard table here i am sending my code .please advice me.
Moderator Message: Please post only relevant portions of your code. There is a 2,500 character per post limit.
here the second grid is editable.and i have to make changes in the second grid and save it to the standard tables. please advice me resma
Edited by: kishan P on Sep 13, 2010 3:59 PMHi,
I have done that many times. Create a button in the toolbar,say 'SAVE'. Write the code in the subroutine user command.For example :
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA : REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: L_VALID TYPE C.
*Code to reflect the changes done in the internal table
IF REF_GRID IS INITIAL.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = REF_GRID.
ENDIF.
IF NOT REF_GRID IS INITIAL.
CALL METHOD REF_GRID->CHECK_CHANGED_DATA
IMPORTING
E_VALID = L_VALID.
ENDIF.
CASE SY-UCOMM.
WHEN 'SAVE'.
PERFORM BDC."Write all you BDC code in this subroutine
ENDCASE.
ENDFORM.
Hope this will help.
Thanks & Regards,
Rock. -
How to include Time Interval in crystal report
Hi All,
I have to create a crystal report in XI release 2. In the report I have 2 query side prompts "FromDate" and "ToDate" and one report side prompt "Time Interval". I have to show the data for each time interval between the two dates. means suppose if my "Fromdate" is 23 March 2010 and "Todate" is 25 march 2010 and time interval is 1 hour then I have to show data for each 1 hour time gap. means suppose my data in Db starts from 23 march 2010,11:25:25 then I must show data between 11:25:15 to 12:25:15 and so on...upto 25 march 2010.
I am not able to retrieve the data accordingly. And how to use the timeinterval to retrieve data from db for that particular time interval.Please reply asap.
Edited by: anushree2187 on May 21, 2010 7:28 AM
Edited by: anushree2187 on May 21, 2010 7:37 AMyou can create a group on the date field and then select how to group it by date, you can go up to the second.
-
How to assign t-code to the report painter
Dear expert,
Would like to seek for advice for the step to assign the T-code to report painter.
Kindly advise.
Thank you.
Regards,
Karen
Moderator: Please, search SDNHi
1. Create the transaction code,say, ZF01_TCODE from Se93
2. Choose "Transaction with parameters".. Press enter
3. Enter START_REPORT in the Transaction field and press Enter
4. Select the Skip initial screen and Inherit GUI attributes check boxes
5. On the same screen, scroll down to the Default Values table and select parameters D_SREPOVARI-REPORTTYPE and
D_SREPOVARI-REPORT.
6. Enter RW for the report type and your report group ZCC8 as the report value
7. Now you can save your transaction and transport it to other systems
Regards
Ajay M -
How to modify existing code of SQVI report?
Hi Expert,
There is a SQVI report which has already been created but we need to change the one for new requirement.
is there any way to modify existing code for new requirement?
Can we edit in abap workbench?
Thanks & Regards
SavitaSavita,
You can not modify SQVI system generated code. You need to go to SAVI change mode and make modifications. If your requirement is a sort of additional fields or inserting come code into the program , then SQVI is not the choice. You need to use Infoset Queries (SQ03, SQ02, Sq01).
KJogeswaraRao -
How to lock transaction codes in ABAP report
Hello all,
I'm now planning to lock several transaction codes as a batch job to prevent end users from using locked tr-cds while processing batch jobs during online service period.
I found out tr-cd: SM01 to lock tr-cds, but I don't get what I can do with this tr-cd when you want to execute this as a background job.
I suppose I can make it by using transaction recorder or call transaction.
But I want to do this in smarter manner (like executing certain report PGM with a variant containing tr-cds to be locked).
I rather prefer using FM or BAPI to using transaction recorder etc if possible...
If you know anything on this issue, please please help me..
HozyHi,
Not quite correct - this is the FM that posts a record about the lock/unlock to the audit log (SM01 calls it), but ir doesn't change the transaction lock itself.
Here is a sample report that does do the trick. You may want to change it to your needs, e.g. allow changing multiple transactions in one run:
REPORT ZTXLOCK.
parameters:
p_tcode type tcode obligatory,
p_mode type char1 obligatory. "L=lock, U=unlock
tables: tstc.
at selection-screen on p_tcode.
select single * from tstc where tcode = p_tcode.
if sy-subrc <> 0.
message e002(sy) with 'Transaction code not found'.
endif.
at selection-screen on p_mode.
if p_mode na 'LU'.
message e002(sy) with 'Invalid mode, use L (lock), U (unlock)'.
endif.
start-of-selection.
case p_mode.
when 'L'.
perform bit-set(sapmtstc) using tstc-cinfo 6.
when 'U'.
perform bit-reset(sapmtstc) using tstc-cinfo 6.
endcase.
update tstc.
if sy-dbcnt = 0.
message e002(sy) with 'TSTC update failed'.
endif.
Regards,
Mark
Maybe you are looking for
-
How to export a PDF to a word document? at the moment it came up with "The encoding (CMap) specified by a font is missing ????? what can I do? thanks
-
Any function module for getting fiscal year week numbers
can any one provide me function module for getting fiscal year week numbers ? if no function module please let me know work around. Thanks! Lakshmikandh
-
Content Search Web Part - Sorting not working
I recently tried the new Content Search Web Part for which i see tremendous potential. I wanted to use it to show a certain type of pages and that was not a problem (i added a url as the source where i got the pages from). I mapped the correct fields
-
Problem in opening the Email.
An email is sent out of CRM and that Email is in interaction history, but I canu2019t open it. Email is showing on calendar as a private appointment. Why is this happening?Please suggest.
-
How can I show formulas in spreadsheet AW6?
I did a spreadsheet in Claris Works and was able to switch back and forth between the results of some calulations and the formulas. In a AW6 spreadsheet I can't figure out how to show the formulas. I've gone to Menu>Option>display>formulas (plus all