Need custome program for qe51n (inspection result recording)
Hi Gurus,
I am getting the same error from the BAPI BAPI_INSPOPER_RECORDRESULTS. Defects occured during confirmatio you find any solution? If yes please share me the solution and sample code give some ssample code .
Javed
Edited by: Javed Parvez on Jun 8, 2009 2:58 PM
Dear Neeraj
one suggestion would be create an qualitative MIC and give the short text " Inspection according to Drawing specification". Create a characteristic code as 1) Ok 2) Not ok. So while result recording you select ok or not ok according to the result and in Inspection Decription you can insert your comments
Regards
gajesh
Similar Messages
-
FM for Quality Inspection Results Recording.
Hello!
I was wondering if someone can help me out on this one:
The requirement calls for entering the same set of results for several inspection lots. Short of using batch input, is there a function module that can enter the results of an inspection lot?
Thanks in advance. Points for anyone who can give helpful answers...Hi Vidhya,
Can you please elucidate the isuue a bit more in detail........ in which tab during result recording you are trying to attach file......So I can help with what ever little I know in SAP...........
Regards
Kaushik -
Program to upload inspection results
Hi,
for go-live, I need a program to upload inspection results in inspections lots and take usage decisions.
Can you tell me what I can use?
Thanks. JessicaNothing standard here. These are usually written ABAP programs.
I would suggest looking at how IDOC's are formatted. I beleive your programmer's should be able to find a standard process for using an IDOC to update the inspection results.
Once the results are loaded, I would use the Auto UD program or collective UD to make the UD's. Those that have off-spec results will have to be done manually. Hopefully there will only be a handful of these.
Craig -
Need standrad program for vendor aging report
Hi
Need standrad program for vendor aging report.
Please reply me only standrad programs.
Point are sure.
Regards,
kumarHi Pankaj
sorry to say that this is not my required program.
I need vendor aging report like s_alr_87012178 tc leads to customer aging report.
Thanks for your effort.
points are awarded.
Regards,
kumar -
How to create a customer program for "PPMOD"feature(pe03)?
Hi,
I want to create customer program for "PPMOD"feature(tcode:pe03),who can tell me the steps? (ECC6.0)
thanks a lot?
Olivia YangHi,
/1PAPA/FEAT610PPMOD the generated program for the feature.
You are forbidden to change this generated program. Ideally whatever logic regarding the feature needs to be put through pe03 tcode of feature and not in the program.
Still if there are any changes that need to be done to the program you can enhance the program.
To enhance the program you need to go to se 38 and open this program and press Shift + F4
Then Goto->Enhancement operations->Show implicit enhancement operations
Then go to yellow line right click on mouse and Enhancement implementation->Create
And put your own code in the implementation.
Regards,
Divya -
Custom program for Dynamic Actions
Iam using BDCs for Actions and Org.Assignment infotypes. The dynamic actions are planned to be carried out by using separate function modules.
My query is, On the plausibility check conditions lots of structures are referred (eg: PSPAR,RP50D etc). How do i perform this condition check in the custom program (for dynamic actions) as these structures do not have any data?
Thanks
Message was edited by: SShenoy1. PSAVE-FIELDNAME will use the old values in the FIELD. It will be used in cases when we have to do plausibility checks on the basis of new as well as old value, eg, we want to use dynamic action for employees whose status changes from 'inactive' to 'active'
2. Sequence no represents sequence no. If for a particular Infotype and FCode, we have to specify which step has to be performed first. Sequence no tells the system exactly this thing.
Regards
Lincoln -
Need sample programs for inbound & outbound interfaces in abap hr?
hi friends
i need sample programs for inbound & outbound interface programs in hr abap . any one send me pls
thanks & regards
deepurd&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Report ZPROG65_11 *
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
REPORT zprog65_11 .
TABLES : lfa1.
TYPES : BEGIN OF ven ,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs ,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
spars LIKE lfa1-spras,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
anred LIKE lfa1-anred ,
END OF ven .
DATA : t_ven TYPE TABLE OF ven WITH HEADER LINE ,
t_bdc LIKE TABLE OF bdcdata WITH HEADER LINE .
DATA : v_file TYPE string ,
v_temp TYPE i ,
v_lifnr(10) TYPE n,
v_hdate LIKE sy-datum.
DATA : c_tcode LIKE sy-tcode .u201Dvalue u2018XK01u2032.
PARAMETERS : p_file(30) DEFAULT u2018c:\vendor1_11.txtu2019,
p_group LIKE apqi-groupid.
START-OF-SELECTION .
MOVE p_file TO v_file .
PERFORM file_upload TABLES t_ven USING v_file .
v_hdate = sy-datum - 1.
CALL FUNCTION u2018BDC_OPEN_GROUPu2019
EXPORTING
client = sy-mandt
DEST = FILLER8
group = p_group
holddate = v_hdate
keep = u2018Xu2019
user = sy-uname
IMPORTING
QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
OTHERS = 11
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT t_ven .
clear lfa1.
v_temp = 0.
MOVE t_ven-lifnr TO v_lifnr.
SELECT SINGLE * FROM lfa1 INTO lfa1 WHERE lifnr =
v_lifnr.
IF sy-subrc = 0.
WRITE :/ u2018foundu2019.
v_temp = 1.
else.
write: / u2018not foundu2019.
ENDIF.
IF v_temp = 0.
c_tcode = u2018xk01u2032.
PERFORM fill_ddc_table .
ELSEIF v_temp = 1.
c_tcode = u2018xk02u2032.
PERFORM fill_bdc_table .
ENDIF.
CALL FUNCTION u2018BDC_INSERTu2019
EXPORTING
tcode = c_tcode
TABLES
dynprotab = t_bdc
EXCEPTIONS
internal_error = 1
OTHERS = 7.
REFRESH t_bdc .
ENDLOOP .
CALL FUNCTION u2018BDC_CLOSE_GROUPu2019
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form file_upload
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013>P_T_VEN text
u2013>P_V_FILE text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM file_upload TABLES p_tven STRUCTURE t_ven
USING p_vfile.
CALL FUNCTION u2018GUI_UPLOADu2019
EXPORTING
filename = p_vfile
filetype = u2018ASCu2019
has_field_separator = u2018Xu2019
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = p_tven
EXCEPTIONS
file_open_error = 1
file_read_error = 2
OTHERS = 17
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. u201D file_upload
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form FILL_DDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013> p1 text
<u2013 p2 text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM fill_ddc_table .
SCREN 100
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180100u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-LIFNRu2019.
t_bdc-fval = t_ven-lifnr .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-BUKRSu2019.
t_bdc-fval = t_ven-bukrs.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-EKORGu2019.
t_bdc-fval = t_ven-ekorg.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-KTOKKu2019.
t_bdc-fval = t_ven-ktokk.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
110
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180110u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-NAME1u2032.
t_bdc-fval = t_ven-name1 .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SORTLu2019.
t_bdc-fval = t_ven-sortl.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-LAND1u2032.
t_bdc-fval = t_ven-land1.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SPRASu2019.
t_bdc-fval = t_ven-spars.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
120
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180120u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
130
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180130u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=ENTRu2019.
APPEND t_bdc. CLEAR t_bdc.
210
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180210u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFB1-AKONTu2019.
t_bdc-fval = t_ven-akont .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFB1-FDGRVu2019.
t_bdc-fval = t_ven-fdgrv.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
215
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180215u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
220
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180220u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
310
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180310u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFM1-WAERSu2019.
t_bdc-fval = t_ven-waers .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
320
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180320u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=UPDAu2019.
APPEND t_bdc. CLEAR t_bdc.
ENDFORM. u201CFILL_DDC_TABLE
u201D FILL_DDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form FILL_BDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013> p1 text
<u2013 p2 text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM fill_bdc_table .
SCREN 101
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180101u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-LIFNRu2019.
t_bdc-fval = t_ven-lifnr .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-BUKRSu2019.
t_bdc-fval = t_ven-bukrs.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-EKORGu2019.
t_bdc-fval = t_ven-ekorg.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
110
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180110u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018lfa1-anredu2019.
t_bdc-fval = t_ven-anred .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-NAME1u2032.
t_bdc-fval = t_ven-name1 .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SORTLu2019.
t_bdc-fval = t_ven-sortl.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-LAND1u2032.
t_bdc-fval = t_ven-land1.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SPRASu2019.
t_bdc-fval = t_ven-spars.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
300
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180300u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=YESu2019.
APPEND t_bdc. CLEAR t_bdc.
ENDFORM. u201D FILL_BDC_TABLE
Best Regards -
I need a program for camera.The androide has a program IP Cam View basic that has the fohu HA 425 and I get the cameras.I downlouded the IP camera viewer in the Aple but this program doesnt have the fuho HA 425. Which apple program is compatible?
Hi,
As far as I know, Sony Ericsson Z520, like a lot of the other cell phones, doesn�t support bluetooth serial communication.
See:
http://developer.sonyericsson.com/entry.jspa?externalID=138&categoryID=5
BUT(!) You should double check this information.
If you ask me, we have done similar project.
We are working on hobby project � our robot use J2ME cell phone as on-board brain.
And there is connection between this small robot and Linux-based PC.
Communication was done via BlueTooth (in reality we use Linux implementation of BlueTooth stack and obexftp).
BUT (!) We use Siemens S75 for this communication.
I�m afraid that Siemens is the only manufacture, which implemented serial communication over bluetooth, embedded camera and non-usb socket.
Also there are some Motorola phones, which implement serial communication over bluetooth.
But � note that all Motorola phones use USB sockets and it will not be easy for you to make connection between such a phone and the robot.
If you need just connection between cell phone and PC, then may be USB is OK too.
Our robot project: www.RoboHobby.com -
Need genealogy program for imac intel
I need genealogy program for new imac intel. My old program was for Apple G II S. Have viewed program called heredis mac x.2 but don't know if it is compatible for imac intel. All new territory for me. Thank you, Lisa
Though I don't have an Intel Mac, I use both Heredis and Reunion. You could check with each company about Intel compatibility.
I keep my file in both because the FH represents the greatest investment of time for anything on the computer. I want always to have a usable file so dont put all my eggs in one basket.
Reunion is a bit more versatile inrespect of the fundamental structures but Heredis uses a different basic construction which I wanted as a reserve. Heredis is about £20 less expensive here in UK than Reunion.
One specific thing about Heredis is that it stores the actual data file or files as documents in the user documents folder. You need to realise what these things are in said folder and not delete them by accident.
The down side of using two different programmes is that of synchronisation. If you add new data in one app you need to add it manually in the other. I would never trust it to GEDCOM transfer to transfer all fields correctly especially if you have data in the more esoteric fields of any particular programme.
Heredis has an ability to display a 3d tree showing all, I repeat all the relationships including the families of removed cousins etc rather like a complex organic molecule. It is zoomable and you can get text data displayed from any person box, any 'atom' ,to pursue the analogy. It has source and repository features just as good as the more expensive Reunion. It may be ruled out for some though. It has no tab to indicate the 'disposal' of a family member as being "abducted by aliens', whereas Reunion has! -
Needed sample program for emailing the report output
hi all,
neede sample program for emailing the report outputHi,
Please refer this program for sending e-mail with attachment.
***INCLUDE ZHZLPP_CLZSN_DAILY_MIS_PRINT .
*& Form print
* text
* --> p1 text
* <-- p2 text
FORM print .
DATA: wa_output_options TYPE ssfcompop,
wa_control_parameters TYPE ssfctrlop,
t_otfdata TYPE ssfcrescl,
t_pdf_tab TYPE TABLE OF tline WITH HEADER LINE.
DATA: t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE i.
DATA: w_bin_filesize TYPE i.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
w_return TYPE ssfcrescl.
DATA : l_mean TYPE p DECIMALS 2,
l_mean1 TYPE p DECIMALS 2,
l_mean2 TYPE p DECIMALS 2,
l_mean3 TYPE p DECIMALS 4,
temp TYPE p DECIMALS 2,
v_header LIKE zmisdisp3-remark,
disp_d_kwh_mt TYPE zmisdisp5,
disp_m_kwh_mt TYPE zmisdisp5,
disp_d_mt_mw TYPE zmisdisp5,
disp_m_mt_mw TYPE zmisdisp5,
l_bptarget(16) TYPE p DECIMALS 2,
l_act_d(16) TYPE p DECIMALS 2,
l_act_c(16) TYPE p DECIMALS 2,
l_pow_gen TYPE p DECIMALS 2,
l_pow_gen_d TYPE p DECIMALS 2,
l_pow_gen_c TYPE p DECIMALS 2,
l_no_of_days TYPE p,
disp_bptarget TYPE zmisdisp5,
disp_act_d TYPE zmisdisp5,
disp_act_c TYPE zmisdisp5,
disp_d_kwh TYPE zmisdisp5,
disp_c_kwh TYPE zmisdisp5,
disp_d_mw TYPE zmisdisp5,
disp_c_mw TYPE zmisdisp5,
disp_pow_gen_d TYPE zmisdisp5,
disp_pow_gen_c TYPE zmisdisp5,
disp_pow_gen TYPE zmisdisp5,
disp_ftd_h1 TYPE zmisdisp5,
disp_ftd_h2 TYPE zmisdisp5,
disp_ftd_h3 TYPE zmisdisp5,
disp_ftd_h4 TYPE zmisdisp5,
disp_ftd_h5 TYPE zmisdisp5,
disp_ftd_o1 TYPE zmisdisp5,
disp_ftd_o2 TYPE zmisdisp5,
disp_ftd_o4 TYPE zmisdisp5,
disp_ftd_o5 TYPE zmisdisp5,
disp_***_o1 TYPE zmisdisp5,
disp_***_o2 TYPE zmisdisp5,
disp_***_o4 TYPE zmisdisp5,
disp_***_o5 TYPE zmisdisp5,
disp_cath_d TYPE zmisdisp5,
disp_cath_c TYPE zmisdisp5,
disp_anode_d TYPE zmisdisp5,
disp_anode_c TYPE zmisdisp5,
l_rec_con_d_kwh(16) TYPE p DECIMALS 2,
l_rec_con_c_kwh(16) TYPE p DECIMALS 2,
l_rec_con_d_mw(16) TYPE p DECIMALS 2,
l_rec_con_c_mw(16) TYPE p DECIMALS 2,
tot_kah TYPE p DECIMALS 2,
avg_kah TYPE p DECIMALS 2,
disp_tot_kah TYPE zmisdisp5,
disp_avg_kah TYPE zmisdisp5,
v_ftd_h1 TYPE p DECIMALS 2,
v_ftd_h2 TYPE p DECIMALS 2,
v_ftd_h3 TYPE p DECIMALS 2,
v_ftd_h4 TYPE p DECIMALS 2,
v_ftd_h5 TYPE p DECIMALS 2,
v_ftd_o1 TYPE p DECIMALS 2,
v_ftd_o2 TYPE p DECIMALS 2,
v_ftd_o4 TYPE p DECIMALS 2,
v_ftd_o5 TYPE p DECIMALS 2,
v_***_o1 TYPE p DECIMALS 2,
v_***_o2 TYPE p DECIMALS 2,
v_***_o4 TYPE p DECIMALS 2,
v_***_o5 TYPE p DECIMALS 2,
l_cdiff1 LIKE imrg-cdiff,
l_cdiff2 LIKE imrg-cdiff,
l_cdiff3 LIKE imrg-cdiff,
l_cdiff4 LIKE imrg-cdiff,
l_path LIKE rlgrap-filename,
l_flag.
DATA :prod_disp TYPE TABLE OF zmisdisp1 WITH HEADER LINE,
keyp_disp TYPE TABLE OF zmisdisp2 WITH HEADER LINE,
keyp_dis1 TYPE TABLE OF zmisdisp2 WITH HEADER LINE,
rmat_disp TYPE TABLE OF zmisdisp4 WITH HEADER LINE,
rcur_disp TYPE TABLE OF zmisdisp6 WITH HEADER LINE,
rhrs_disp TYPE TABLE OF zmisdisp4 WITH HEADER LINE,
brkd_disp TYPE TABLE OF zmisdisp7 WITH HEADER LINE.
DEFINE fill_kpp.
clear l_flag.
loop at it_mic_data where kurztext = &1.
l_mean1 = it_mic_data-mittelwert.
l_mean = it_mic_data-mean.
if l_flag = ' '.
move : &2 to keyp_disp-desc,
l_mean1 to keyp_disp-ftd.
if it_mic_data-kurztext = 'Ingot Pb SHG Zinc'.
l_mean2 = v_mean_pbshg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Cu SHG Zinc'.
l_mean2 = v_mean_cushg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Cd SHG Zinc'.
l_mean2 = v_mean_cdshg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Fe SHG Zinc'.
l_mean2 = v_mean_feshg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Zn SHG Zinc'.
l_mean2 = v_mean_znshg.
move l_mean2 to keyp_disp-avg.
else.
move l_mean to keyp_disp-avg.
endif.
if it_mic_data-masseinhsw = 'GLI'.
move 'g/l' to keyp_disp-unit.
elseif it_mic_data-masseinhsw = 'PPM'.
move 'ppm' to keyp_disp-unit.
elseif it_mic_data-masseinhsw = 'NO'.
move 'no' to keyp_disp-unit.
else.
move it_mic_data-masseinhsw to keyp_disp-unit.
endif.
append keyp_disp.
clear keyp_disp.
move 'X' to l_flag.
else.
move : l_mean1 to keyp_disp-ftd.
append keyp_disp.
clear keyp_disp.
endif.
endloop.
if sy-subrc is not initial.
move &2 to keyp_disp-desc.
append keyp_disp.
clear keyp_disp.
endif.
END-OF-DEFINITION.
DEFINE fill_kp1.
clear l_flag.
loop at it_mic_data where kurztext = &1.
l_mean1 = it_mic_data-mittelwert.
l_mean = it_mic_data-mean.
if l_flag = ' '.
move : &2 to keyp_dis1-desc,
l_mean1 to keyp_dis1-ftd.
if it_mic_data-kurztext = 'Ingot Pb SHG Zinc'.
l_mean2 = v_mean_pbshg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Cu SHG Zinc'.
l_mean2 = v_mean_cushg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Cd SHG Zinc'.
l_mean2 = v_mean_cdshg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Fe SHG Zinc'.
l_mean2 = v_mean_feshg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Zn SHG Zinc'.
l_mean3 = v_mean_znshg.
move l_mean3 to keyp_dis1-avg.
clear l_mean3.
l_mean3 = it_mic_data-mittelwert.
move l_mean3 to keyp_dis1-ftd.
else.
move l_mean to keyp_dis1-avg.
endif.
if it_mic_data-masseinhsw = 'GLI'.
move 'g/l' to keyp_dis1-unit.
elseif it_mic_data-masseinhsw = 'PPM'.
move 'ppm' to keyp_dis1-unit.
elseif it_mic_data-masseinhsw = 'NO'.
move 'no' to keyp_dis1-unit.
else.
move it_mic_data-masseinhsw to keyp_dis1-unit.
endif.
append keyp_dis1.
clear keyp_dis1.
move 'X' to l_flag.
else.
if it_mic_data-kurztext = 'Ingot Zn SHG Zinc'.
clear l_mean3.
l_mean3 = it_mic_data-mittelwert.
move l_mean3 to keyp_dis1-ftd.
else.
move : l_mean1 to keyp_dis1-ftd.
endif.
append keyp_dis1.
clear keyp_dis1.
endif.
endloop.
if sy-subrc is not initial.
move &2 to keyp_dis1-desc.
append keyp_dis1.
clear keyp_dis1.
endif.
END-OF-DEFINITION.
*FIRST PAGE
********PLANT HEADER
MOVE 'CLZS HYDRO I PLANT - DAILY PRODUCTION REPORT' TO v_header.
********Production figure
LOOP AT it_disp1.
prod_disp-desc = it_disp1-desc.
prod_disp-d_plnmg = it_disp1-d_plnmg.
prod_disp-d_menge = it_disp1-d_menge.
prod_disp-u_plnmg = it_disp1-u_plnmg.
prod_disp-u_menge = it_disp1-u_menge.
prod_disp-avg = it_disp1-avg.
prod_disp-ask_rate = it_disp1-ask_rate.
prod_disp-m_plnmg = it_disp1-m_plnmg.
prod_disp-y_plnmg = it_disp1-y_plnmg.
prod_disp-y_menge = it_disp1-y_menge.
prod_disp-y_variance = it_disp1-y_variance.
APPEND prod_disp.
ENDLOOP.
********Key performance parameters
MOVE 'ROASTER :' TO keyp_disp-desc.
APPEND keyp_disp.
fill_kpp '% S/S IN 45 DEG' ' S/S in Calcine'.
MOVE 'LEACHING :' TO keyp_disp-desc.
APPEND keyp_disp.
fill_kpp '% S/S IN CAL' ' S/S in Calcine'.
fill_kpp '%water soluble Zn' ' W/S Zn in Jarosite Cake'.
fill_kpp '%total Zn in HBF' ' T/Zn in Jarosite cake'.
fill_kpp 'ZINC IN CT' ' Zn in Conditioning tank'.
fill_kpp 'g/l zn in neutral overflow' ' Zn in Electrolyte Prod (gpl)'.
fill_kpp 'PPM CU IN PS25' ' Purified Solution Cu'.
fill_kpp 'PPM CADMIUM IN PS25' ' Purified Solution Cd'.
fill_kpp 'PPM COBALT IN PS25' ' Purified Solution Co'.
MOVE 'CELLHOUSE :' TO keyp_disp-desc.
APPEND keyp_disp.
fill_kpp 'g/l zinc in cell feed' ' Cell Feed Zinc gpl'.
fill_kpp 'GPL ACID IN CELL FEED' ' Cell Feed acidity gpl'.
fill_kpp 'g/l manganese in cell feed' ' Cell Feed Mn gpl'.
LOOP AT t_imrg_add_disp.
MOVE: t_imrg_add_disp-desc TO keyp_disp-desc,
t_imrg_add_disp-d_value TO keyp_disp-ftd,
t_imrg_add_disp-c_value TO temp,
temp TO keyp_disp-avg.
IF t_imrg_add_disp-units = 'NO'.
MOVE: 'no' TO keyp_disp-unit.
ELSE.
MOVE: t_imrg_add_disp-units TO keyp_disp-unit.
ENDIF.
APPEND keyp_disp.CLEAR keyp_disp.
ENDLOOP.
fill_kp1 'Ingot Pb SHG Zinc' ' Ingot Pb SHG Zinc'.
fill_kp1 'Ingot Cu SHG Zinc' ' Ingot Cu SHG Zinc'.
fill_kp1 'Ingot Cd SHG Zinc' ' Ingot Cd SHG Zinc'.
fill_kp1 'Ingot Fe SHG Zinc' ' Ingot Fe SHG Zinc'.
fill_kp1 'Ingot Zn SHG Zinc' ' Ingot Zn SHG Zinc'.
********Cellhouse power
CATCH SYSTEM-EXCEPTIONS bcd_zerodivide = 1.
v_m_kwh_mt = v_ind8_m / cathode_recipt.
v_m_mt_mw = cathode_recipt / ( v_ind8_m / 24000 ).
ENDCATCH.
MOVE : v_d_kwh_mt TO disp_d_kwh_mt,
v_m_kwh_mt TO disp_m_kwh_mt,
v_d_mt_mw TO disp_d_mt_mw,
v_m_mt_mw TO disp_m_mt_mw.
*SECOND PAGE
********Raw Material
LOOP AT it_disp3.
rmat_disp-desc = it_disp3-desc.
rmat_disp-opstk = it_disp3-opstk.
rmat_disp-d_recpt = it_disp3-d_recpt.
rmat_disp-u_recpt = it_disp3-u_recpt.
rmat_disp-d_cons = it_disp3-d_cons.
rmat_disp-u_cons = it_disp3-u_cons.
rmat_disp-clstk = it_disp3-clstk.
APPEND rmat_disp.
ENDLOOP.
********Work in Progress
********Finished Goods
********power consumption
l_no_of_days = v_mm_en_dt+6(2).
CATCH SYSTEM-EXCEPTIONS bcd_zerodivide = 1.
l_bptarget = ( v_bp_nrms_p * v_gross_d ) / l_no_of_days.
l_act_d = v_ind6_d + v_ind2_d - ( v_ind3_d + ( v_ind4_d / 2 ) ) - v_ind5_d.
l_act_c = v_ind6_m + v_ind2_m - ( v_ind3_m + ( v_ind4_m / 2 ) ) - v_ind5_m.
l_pow_gen = ( v_ind2_d / 1000 ) / v_ind7_d.
ENDCATCH.
l_pow_gen_d = v_ind2_d / 1000.
l_pow_gen_c = v_ind9_m / 1000.
l_rec_con_d_kwh = v_ind8_d.
l_rec_con_c_kwh = v_ind8_m.
l_rec_con_d_mw = v_ind8_d / 24000.
l_rec_con_c_mw = v_ind8_m / ( 24000 * v_days_pased ).
LOOP AT t_disp_curr.
rcur_disp-time = t_disp_curr-time.
rcur_disp-current = t_disp_curr-current.
rcur_disp-kah = t_disp_curr-kah.
APPEND rcur_disp.
AT LAST.
SUM.
tot_kah = t_disp_curr-kah.
ENDAT.
ENDLOOP.
avg_kah = tot_kah / '24'.
*********************running hrs
LOOP AT it_disp6.
rhrs_disp-desc = it_disp6-desc.
rhrs_disp-opstk = it_disp6-d_runhrs.
rhrs_disp-d_recpt = it_disp6-m_runhrs.
APPEND rhrs_disp.
ENDLOOP.
rhrs_disp-desc = 'Turbo Generator'.
rhrs_disp-opstk = v_turbod.
rhrs_disp-d_recpt = v_turboc.
INSERT rhrs_disp INDEX 2.
**********************BREAK_DOWN & OIL
CLEAR value.
LOOP AT itab2.
IF itab2-equnr = 'NMZ-EH01G001'.
PERFORM s_conversion_h.
v_ftd_h1 = v_ftd_h1 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01G002'.
PERFORM s_conversion_h.
v_ftd_h2 = v_ftd_h2 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01V003'.
PERFORM s_conversion_h.
v_ftd_h3 = v_ftd_h3 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01V001'.
PERFORM s_conversion_h.
v_ftd_h4 = v_ftd_h4 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01V002'.
PERFORM s_conversion_h.
v_ftd_h5 = v_ftd_h5 + value.
CLEAR value.
ENDIF.
ENDLOOP.
LOOP AT t_oil.
AT END OF ind.
SUM.
IF t_oil-ind = 1.
v_***_o1 = t_oil-cdiff * 1000.
ELSEIF t_oil-ind = 2.
v_***_o2 = t_oil-cdiff * 1000.
ELSEIF t_oil-ind = 3.
v_***_o4 = t_oil-cdiff * 1000.
ELSEIF t_oil-ind = 4.
v_***_o5 = t_oil-cdiff * 1000.
ENDIF.
ENDAT.
IF t_oil-idate = p_repdt.
IF t_oil-ind = 1.
l_cdiff1 = l_cdiff1 + t_oil-cdiff.
ELSEIF t_oil-ind = 2.
l_cdiff2 = l_cdiff2 + t_oil-cdiff.
ELSEIF t_oil-ind = 3.
l_cdiff3 = l_cdiff3 + t_oil-cdiff.
ELSEIF t_oil-ind = 4.
l_cdiff4 = l_cdiff4 + t_oil-cdiff.
ENDIF.
ENDIF.
ENDLOOP.
v_ftd_o1 = l_cdiff1 * 1000.
v_ftd_o2 = l_cdiff2 * 1000.
v_ftd_o4 = l_cdiff3 * 1000.
v_ftd_o5 = l_cdiff4 * 1000.
*********Breakdown details----3rd page
LOOP AT itab INTO wa.
CALL FUNCTION 'FLTP_CHAR_CONVERSION'
EXPORTING
decim = 0
expon = 0
input = wa-auszt
ivalu = 'X'
IMPORTING
flstr = wk_char_auszt.
CONDENSE wk_char_auszt NO-GAPS.
wk_flt_auszt = wk_char_auszt.
wk_flt_auszt = wk_flt_auszt / 3600.
duration = wk_flt_auszt.
brkd_disp-eqdesc = wa-eqktx.
brkd_disp-nodesc = wa-qmtxt.
brkd_disp-hrs = duration.
APPEND brkd_disp.
ENDLOOP.
MOVE : v_ftd_h1 TO disp_ftd_h1,
v_ftd_h2 TO disp_ftd_h2,
v_ftd_h3 TO disp_ftd_h3,
v_ftd_h4 TO disp_ftd_h4,
v_ftd_h5 TO disp_ftd_h5,
v_ftd_o1 TO disp_ftd_o1,
v_ftd_o2 TO disp_ftd_o2,
v_ftd_o4 TO disp_ftd_o4,
v_ftd_o5 TO disp_ftd_o5,
v_***_o1 TO disp_***_o1,
v_***_o2 TO disp_***_o2,
v_***_o4 TO disp_***_o4,
v_***_o5 TO disp_***_o5,
l_bptarget TO disp_bptarget,
l_act_d TO disp_act_d,
l_act_c TO disp_act_c,
l_rec_con_d_kwh TO disp_d_kwh,
l_rec_con_c_kwh TO disp_c_kwh,
l_rec_con_d_mw TO disp_d_mw,
l_rec_con_c_mw TO disp_c_mw,
tot_kah TO disp_tot_kah,
avg_kah TO disp_avg_kah,
l_pow_gen TO disp_pow_gen,
l_pow_gen_d TO disp_pow_gen_d,
l_pow_gen_c TO disp_pow_gen_c,
v_cath_d TO disp_cath_d,
v_cath_c TO disp_cath_c,
v_anode_d TO disp_anode_d,
v_anode_c TO disp_anode_c.
wa_output_options-tdimmed = 'X'.
wa_control_parameters-device = 'PRINTER'.
wa_control_parameters-preview = 'X'.
IF rb3 = 'X'.
wa_control_parameters-getotf = 'X'.
wa_control_parameters-no_dialog = 'X'.
ENDIF.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZHZLPP_CLZSN_DAILY_MIS'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = wa_control_parameters
output_options = wa_output_options
user_settings = 'X'
header = v_header
date = p_repdt
l_bptarget = disp_bptarget
l_act_d = disp_act_d
l_act_c = disp_act_c
disp_d_kwh = disp_d_kwh
disp_c_kwh = disp_c_kwh
disp_d_mw = disp_d_mw
disp_c_mw = disp_c_mw
disp_tot_kah = disp_tot_kah
disp_avg_kah = disp_avg_kah
disp_d_kwh_mt = disp_d_kwh_mt
disp_m_kwh_mt = disp_m_kwh_mt
disp_d_mt_mw = disp_d_mt_mw
disp_m_mt_mw = disp_m_mt_mw
disp_pow_gen = disp_pow_gen
disp_pow_gen_d = disp_pow_gen_d
disp_pow_gen_c = disp_pow_gen_c
disp_ftd_h1 = disp_ftd_h1
disp_ftd_h2 = disp_ftd_h2
disp_ftd_h3 = disp_ftd_h3
disp_ftd_h4 = disp_ftd_h4
disp_ftd_h5 = disp_ftd_h5
disp_ftd_o1 = disp_ftd_o1
disp_ftd_o2 = disp_ftd_o2
disp_ftd_o4 = disp_ftd_o4
disp_ftd_o5 = disp_ftd_o5
disp_***_o1 = disp_***_o1
disp_***_o2 = disp_***_o2
disp_***_o4 = disp_***_o4
disp_***_o5 = disp_***_o5
disp_cath_d = disp_cath_d
disp_cath_c = disp_cath_c
disp_anode_d = disp_anode_d
disp_anode_c = disp_anode_c
IMPORTING
job_output_info = w_return " .
TABLES
prod_tab = prod_disp
keyp_tab = keyp_disp
remk_tab = it_remarks
rmat_tab = rmat_disp
rwip_tab = it_disp4
rfng_tab = it_disp_fg
rcur_tab = rcur_disp
rhrs_tab = rhrs_disp
brkd_tab = brkd_disp
keyp_tab1 = keyp_dis1
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE 'Error in printing form' TYPE 'I'.
ENDIF.
********Downloading in pdf format.
IF rb3 = 'X'.
IF l_usract <> 9.
MOVE fullpath TO l_path.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF' "
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
bin_filesize = v_len_in
filename = l_path
filetype = 'BIN'
IMPORTING
filelength = w_filesize
TABLES
data_tab = i_tline
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc = 0.
MESSAGE 'File downloaded successfully' TYPE 'S'.
ENDIF.
ENDIF.
ENDIF.
IF sy-batch = 'X'. " SENDING MAILS IF SCHEDULED IN BACKGROUND
DATA: formname TYPE tdsfname,
fm_name TYPE rs38l_fnam,
control_parameters TYPE ssfctrlop,
output_options TYPE ssfcompop,
job_output_info TYPE ssfcrescl,
otf_data TYPE tsfotf.
DATA: otf TYPE TABLE OF itcoo WITH HEADER LINE,
doctab_archive TYPE TABLE OF docs WITH HEADER LINE,
lines TYPE TABLE OF tline WITH HEADER LINE,
bin_filesize TYPE i.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZHZLPP_CLZSN_DAILY_MIS'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
control_parameters-no_dialog = 'X'.
control_parameters-getotf = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = control_parameters
header = v_header
date = p_repdt
l_bptarget = disp_bptarget
l_act_d = disp_act_d
l_act_c = disp_act_c
disp_d_kwh = disp_d_kwh
disp_c_kwh = disp_c_kwh
disp_d_mw = disp_d_mw
disp_c_mw = disp_c_mw
disp_tot_kah = disp_tot_kah
disp_avg_kah = disp_avg_kah
disp_d_kwh_mt = disp_d_kwh_mt
disp_m_kwh_mt = disp_m_kwh_mt
disp_d_mt_mw = disp_d_mt_mw
disp_m_mt_mw = disp_m_mt_mw
disp_pow_gen = disp_pow_gen
disp_pow_gen_d = disp_pow_gen_d
disp_pow_gen_c = disp_pow_gen_c
disp_ftd_h1 = disp_ftd_h1
disp_ftd_h2 = disp_ftd_h2
disp_ftd_h3 = disp_ftd_h3
disp_ftd_h4 = disp_ftd_h4
disp_ftd_h5 = disp_ftd_h5
disp_ftd_o1 = disp_ftd_o1
disp_ftd_o2 = disp_ftd_o2
disp_ftd_o4 = disp_ftd_o4
disp_ftd_o5 = disp_ftd_o5
disp_***_o1 = disp_***_o1
disp_***_o2 = disp_***_o2
disp_***_o4 = disp_***_o4
disp_***_o5 = disp_***_o5
disp_cath_d = disp_cath_d
disp_cath_c = disp_cath_c
disp_anode_d = disp_anode_d
disp_anode_c = disp_anode_c
IMPORTING
job_output_info = job_output_info
TABLES
prod_tab = prod_disp
keyp_tab = keyp_disp
remk_tab = it_remarks
rmat_tab = rmat_disp
rwip_tab = it_disp4
rfng_tab = it_disp_fg
rcur_tab = rcur_disp
rhrs_tab = rhrs_disp
brkd_tab = brkd_disp
keyp_tab1 = keyp_dis1
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc = 0.
otf_data = job_output_info-otfdata[].
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = bin_filesize
TABLES
otf = otf_data[]
doctab_archive = doctab_archive[]
lines = lines[]
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc = 0.
SUBMIT rsconn01 with mode = 'INT' AND RETURN.
* ----<<distrubution list>>----
PERFORM mail_users TABLES lines USING 'MIS-HY1A' v_header. " Donot put more than 8 email-ids
PERFORM mail_users TABLES lines USING 'MIS-HY1B' v_header. " in a distribution list
PERFORM mail_users TABLES lines USING 'MIS-HY1C' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1D' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1E' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1F' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1G' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1H' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1I' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1J' v_header.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " print
*& Form get_download_path
* text
* --> p1 text
* <-- p2 text
FORM get_download_path .
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
window_title = 'Download as pdf file'
default_extension = 'pdf'
IMPORTING
fullpath = fullpath
user_action = l_usract.
IF l_usract = '9'.
STOP.
ENDIF.
ENDFORM. " get_download_path
*& Form mail_users
* text
* -->P_LINES text
* -->P_2153 text
* -->P_V_HEADER text
FORM mail_users TABLES p_lines STRUCTURE tline
USING p_dist_list
p_v_header.
CONSTANTS: c_raw TYPE so_obj_tp VALUE 'RAW',
c_pdf TYPE so_obj_tp VALUE 'PDF',
c_255 TYPE i VALUE 255,
c_134 TYPE i VALUE 134,
c_x TYPE c VALUE 'X'.
DATA: document_data LIKE sodocchgi1 ,
tab_lines TYPE i,
contents_txt TYPE TABLE OF solisti1 WITH HEADER LINE,
contents_bin TYPE TABLE OF solisti1 WITH HEADER LINE,
packing_list TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
object_header TYPE TABLE OF solisti1 WITH HEADER LINE,
receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
l_str(255) ,
v1 TYPE i,
v2 TYPE i,
v3 TYPE i.
document_data-obj_name = 'EMAIL'.
document_data-obj_descr = p_v_header. " SUBJECT LINE
CONCATENATE 'Please find the attached SAP generated Daily Production Report for the day'
p_repdt+6(2)
p_repdt+4(2)
'.' p_repdt+0(4)
INTO contents_txt.
APPEND contents_txt.
CLEAR contents_txt.
APPEND contents_txt.
APPEND contents_txt.
DESCRIBE TABLE contents_txt LINES tab_lines.
READ TABLE contents_txt INDEX tab_lines.
document_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( contents_txt ).
document_data-doc_size = tab_lines .
CLEAR packing_list-transf_bin.
packing_list-head_start = 1.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = tab_lines.
packing_list-doc_type = c_raw.
packing_list-doc_size = document_data-doc_size.
APPEND packing_list.
LOOP AT p_lines.
CLEAR l_str.
l_str+0(2) = p_lines-tdformat.
l_str+2(132) = p_lines-tdline.
v2 = v1 + c_134.
IF v2 LE c_255.
contents_bin-line+v1(c_134) = l_str. v1 = v2.
ELSE.
v3 = v2 - c_255.
v2 = c_255 - v1.
IF NOT v2 IS INITIAL.
contents_bin-line+v1(v2) = l_str+0(v2).
ENDIF.
APPEND contents_bin.
CLEAR contents_bin.
v1 = v3.
v3 = 134 - v1.
IF NOT v1 IS INITIAL.
contents_bin-line+0(v1) = l_str+v3(v1).
ENDIF.
ENDIF.
ENDLOOP.
APPEND contents_bin.
CLEAR contents_bin.
DESCRIBE TABLE contents_bin LINES tab_lines.
READ TABLE contents_bin INDEX tab_lines.
CONCATENATE 'Hy-I Report'
p_repdt+6(2)
p_repdt+4(2)
'.' p_repdt+0(4)
'.pdf'
INTO object_header.
APPEND object_header.
packing_list-transf_bin = c_x.
packing_list-head_start = 1.
packing_list-head_num = 1.
packing_list-body_start = 1.
packing_list-body_num = tab_lines.
packing_list-doc_type = c_pdf.
packing_list-obj_name = 'text1'.
packing_list-obj_descr = 'Production report'.
packing_list-doc_size = tab_lines * 255 + STRLEN( contents_bin ).
APPEND packing_list.
receivers-receiver = p_dist_list.
receivers-rec_type = 'C'.
APPEND receivers.
CLEAR receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
put_in_outbox = ' '
SENDER_ADDRESS = 'CZPPPLG'
SENDER_ADDRESS_TYPE = 'B'
commit_work = 'X'
TABLES
packing_list = packing_list
object_header = object_header
contents_bin = contents_bin
contents_txt = contents_txt
receivers = receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc = 0.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 with mode = 'INT' AND RETURN.
ENDIF.
ENDFORM. " mail_users -
Need upload program for Vendor master partners (XK02)
Hello Experts,
I need to write data uplaod program for XK02 for vendor master Partner functions. ( Basically we created some custom partner functions and attach it to many existing vendors ).
So kindly advice me which is the suitable upload method for this.
1) There is no BAPI available for editing vendors.
2) BDC is not possible because the Vendor partner screen is having table control and some records are already filled. (No of row not fixed).
Is there any IDOC available or any standard input pgm?
Please give suggestion.
Thanks and rgds,
AnandHi,
You can use LSMW --> Vendor Master which supports bothe XK01 and XK02.
This is a standard Batch input program (RFBIKR00). Look at this program documentation for more info.
Regards
Sudhir Atluru -
Inprocess Inspection & result recording
Hi all,
We are implementing QM.
The requirement of client is to carry out inprocess inspection(preferable without inspection plan) including result recording & defect recording & that to with quiet ease.
Help me with the basic settings.
Also to have the relevant report to analyse the inspection activities.
We are using developed T code for operation confirmation, in the back end it is co11n only. So also elaborate the consequences of the same if any.
MangeshRamanuj/ Murali,
Thanks for your reply.
Let me explain the process in details.
We are having around 10 operations.
We need to carry out inprocess inspection for 8 operation starting from 3rd operation.
The inspection to be carried out is like length- 5 cms, shape- ok or not ok, if not ok then what is the defect, assay- 90%, if below 90% then defective like this.
I have assigned inspection type 03 in QM view in the material master.
Inspection lot is also getting created.
I am stuck up at result recording & defect recording.
So kindly guide me how to map this in details.
Efforts would be appreciated.
SmanS -
LSMW Custom program for updating picked quantity in outbound delivery
I have been tasked with creating an LSMW that will update the picked quantity in an outbound delivery. I originally thought of using a recording on transaction vl02n, but I need the LSMW to work with variable amount of item lines.
Through some research I figured out that FM WS_DELIVERY_UPDATE_2 can update the picked quantity. I have successfully created a custom program that calls this FM.
I have created what I believe to be the correct entries in the SXDA0, SXDA1, SXDA2, and SXDA3 tables to make my custom program work with LSMW. I am able to find my program in the "Maintain Object Attributes." I am also able to "Maintain Structure Relations Step" (screen shot attached) I am currently using VBKOK and VBPOK for the header and line item structures respectively.
My difficulty is converting the data. I have tried everything from having no conversion rules to mapping many fields and I always receive the following error (screen shot also provided).
Error analysis
The statement
"Move src TO dst"
requires that the operands "dst" and "src" are convertible.
Since this statement is in a Unicode program, the special conversion
rules for Unicode programs apply.
In this case, these rules were violated.
Program /SAPDMC/SAP_LSMW_CONV_FORMS
Include /SAPDMC/SAP_LSMW_CONV_FORMS
Row 1,080
Module type (FORM)
Module Name TRANSFER_RECORD
Since I have run the conversion with no conversion rules I am very confused as to why I am still receiving this error. Any insight would be greatly appreciated.For anyone I have uncovered some interesting things about my issue. I started going through the conversion code piece by piece trying to figure out what data element the system was choking on.
After digging though the program and using the debugger I found out that the issue was in FORM transfer_record.
ASSIGN (g_record) TO <l_record>.
CASE g_objecttype.
WHEN '01' OR '02'.
gt_buffer-record = g_record.
gt_buffer-data = <l_record>.
APPEND gt_buffer.
If this LSMW was working
g_record = 'VBKOK'
<l_record> = 'VBKOK'
But what is actually happening
g_record = 'VBKOK'
<l_record> = "Structure of some sort
I do not know why this is happening since the field symbol is being assigned right before this piece of code. Any suggestions are greatly appreciated. -
Create a custom program for FPS3 transaction code
Hi,
I would like to create a custome program which does the below steps in one shot.
1) RUN(SUBMIT) Transaction FPS3 with
Company code = NONE and
Created on FROM = SY-DATUM & TO = SY-DATUM
2) In the next screen, it should select SELECT ALL
button
3) and then it should select EXECUTE button.
And alos i should be able to give Information Messages when nothing is selected or displayed.
Thanks & Regards,
Sudheer Pusala.write a z program with company code as parameter. next use Submit function to submit FPS3 with the variables. In the PF-STATUS maintain the required butons which will popup when the data is shown. Now, u can select all records from one of the button of PF-STATUS (u need to write code for it). Next use execute button to execute the data. At any stage u can improper ur custom messages which will get displayed as and when something happens.
-
I need model program for alv grid control
hi all,
i need example program and detailed description of alv grid control . what is the features of alv grid control over normal alv.Hi,
Check out the below sample code.I have pasted even the include programs, u can copy the program.
SAP-User : BWR2KOR *
Author (name) : Bharadwaja R *
Created on/in : 07.02.2006 *
Description : Report for Listing IDOC-Informations for the given *
segment on the selection screen *
Changes: - for each change: add chapter *
- changes get a changes number (ascending) *
- source code has to be marked with SAP-user-name *
change date and number *
Change number : *
Enhance/Change numer: 90xxxx (900001-909999) -> /RB11/YBF_MODIF *
SAP-User : *
Author (name) : *
Created on/in : *
Reason for the change: *
REPORT Y16S_VIEW_IDOC_CONTENT LINE-SIZE 230
NO STANDARD PAGE HEADING.
Data declarations
INCLUDE Y16S_VIEW_IDOC_CONTENT_D01I.
Selection screen
INCLUDE Y16S_VIEW_IDOC_CONTENT_S01I.
Events
INCLUDE Y16S_VIEW_IDOC_CONTENT_E01I.
Routines for program
INCLUDE Y16S_VIEW_IDOC_CONTENT_F01I.
START-OF-SELECTION.
Get the fieldcatalog
PERFORM get_fcat.
**Method for getting the reference for the structure
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING it_fieldcatalog = g_t_fieldcat
IMPORTING ep_table = dref.
**Passing the reference of the structure to field-symbol of type table
ASSIGN dref->* TO .
Fill IDoc data
PERFORM fill_data.
Display ALV
perform display_grid.
INCLUDE Y16S_VIEW_IDOC_CONTENT_D01I *
Data declaration : Tables used *
TABLES : edidd, "Data record (IDoc)
edidc, "Control record (IDoc)
edid4, "IDoc Data Records from 4.0 onwards
dd03d, "Dynpro fields for table fields
edsappl, "EDI: IDoc Segment Application Structure
int_seg, "Data record details display
dd03l, "Table Fields
edisegment. "IDoc Development : IDoc Segment
Name of segment
DATA : g_f_segment LIKE dntab-tabname.
*--Data Declaration.
FIELD-SYMBOLS : TYPE ANY.
DATA : BEGIN OF g_t_edid OCCURS 0,
docnum LIKE edid4-docnum,
segnum LIKE edid4-segnum,
sdata LIKE edid4-sdata,
END OF g_t_edid.
*DATA : g_t_edid LIKE edid4 OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF g_t_edidc OCCURS 0,
docnum LIKE edidc-docnum,
credat LIKE edidc-credat,
mestyp LIKE edidc-mestyp,
END OF g_t_edidc.
DATA : BEGIN OF g_t_appl OCCURS 0,
fieldname LIKE edsappl-fieldname,
END OF g_t_appl.
DATA : g_v_tabix LIKE sy-tabix.
ALV Declarations
*Declaration of type groups
TYPE-POOLS :
slis. "Globale Typen für generische Listbausteine
DATA: g_f_okcode LIKE sy-ucomm,
g_container TYPE scrfname VALUE 'G_C_ALV',
grid1 TYPE REF TO cl_gui_alv_grid,
g_custom_container TYPE REF TO cl_gui_custom_container.
FIELD-SYMBOLS: .
Class
CLASS: g_cl_event DEFINITION DEFERRED.
Alv Grid Constants
DATA : g_c_handle(4) TYPE c VALUE '0100',
g_c_save(1) TYPE c VALUE 'A',
g_c_exit(4) TYPE c VALUE 'EXIT'.
DATA: g_v_layout TYPE lvc_s_layo,
g_f_print TYPE lvc_s_prnt,
g_f_variant TYPE disvariant,
g_v_recv TYPE REF TO g_cl_event.
CONSTANTS : gc_ucomm_sel_criteria(12) VALUE 'SEL_CRITERIA'.
CLASS G_Cl_EVENT DEFINITION
Class to handle GRID Events *
CLASS g_cl_event DEFINITION.
PUBLIC SECTION.
METHODS:
constructor IMPORTING value(grid_name) TYPE REF TO
cl_gui_alv_grid,
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive,
handle_user_command
FOR EVENT user_command OF cl_gui_alv_grid
IMPORTING e_ucomm.
PRIVATE SECTION.
DATA: g_v_alv TYPE REF TO cl_gui_alv_grid.
ENDCLASS. "g_cl_event DEFINITION
CLASS g_cl_events IMPLEMENTATION
Class to handle GRID Events *
CLASS g_cl_event IMPLEMENTATION.
Handling methods
METHOD constructor.
g_v_alv = grid_name.
ENDMETHOD. "constructor
Tool bar
METHOD handle_toolbar.
CONSTANTS:
lc_quickinfo_sel_criteria(111) VALUE 'Show Selection Criteria'.
DATA:
l_toolbar TYPE stb_button.
CLEAR l_toolbar.
MOVE 0 TO l_toolbar-butn_type.
MOVE gc_ucomm_sel_criteria TO l_toolbar-function.
MOVE icon_select_with_condition TO l_toolbar-icon.
MOVE lc_quickinfo_sel_criteria TO l_toolbar-quickinfo.
MOVE space TO l_toolbar-disabled.
APPEND l_toolbar TO e_object->mt_toolbar.
ENDMETHOD. "handle_toolbar
User Command
METHOD handle_user_command.
CASE e_ucomm.
When Exit button is used
WHEN 'EXIT'.
PERFORM exit_program.
WHEN OTHERS.
ENDCASE.
ENDMETHOD. "handle_user_command
ENDCLASS. "g_cl_event IMPLEMENTATION
INCLUDE Y16S_VIEW_IDOC_CONTENT_S01I *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
Creation Date of IDoc
SELECT-OPTIONS : s_date FOR edidc-credat.
IDoc Number
SELECT-OPTIONS : s_idocnm FOR edidc-docnum.
Basic IDoc type
SELECT-OPTIONS : s_idoctp FOR edidc-idoctp.
*Message type
SELECT-OPTIONS : s_mestyp FOR edidc-mestyp.
Segment name
PARAMETERS : p_segnam LIKE edisegment-segtyp OBLIGATORY.
Field name
SELECT-OPTIONS : s_fldnam FOR dd03d-fieldname NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
Field name
PARAMETERS : p_fldnam LIKE dd03d-fieldname.
Field contents of a field of an IDoc segment
SELECT-OPTIONS : s_fldval FOR int_seg-string.
SELECTION-SCREEN END OF BLOCK b2.
INCLUDE Y16S_VIEW_IDOC_CONTENT_E01I *
Check for IDoc number on selection screen
AT SELECTION-SCREEN ON s_idocnm.
IF NOT s_idocnm IS INITIAL.
Data fetch : Control record (IDoc)
SELECT COUNT( * ) FROM edidc
WHERE docnum IN s_idocnm.
IF sy-subrc NE 0.
MESSAGE e429(mo).
ENDIF.
ELSE.
message for required entry.
MESSAGE e055(00).
ENDIF.
Check for segment name on selection screen
AT SELECTION-SCREEN ON p_segnam.
Check segment name is an input on selection screen
IF NOT p_segnam IS INITIAL.
Data fetch : Table Fields
SELECT SINGLE * FROM dd03l
WHERE tabname EQ p_segnam.
IF sy-subrc NE 0.
MESSAGE e429(mo).
ENDIF.
ENDIF.
F4 help for fieldname
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_fldnam-low.
DATA : l_rc LIKE sy-subrc.
Check segment name on selection screen is not empty
IF NOT p_segnam IS INITIAL.
PERFORM get_f4help USING l_rc.
IF l_rc = 0.
Fill the selected field name
READ TABLE g_t_appl INDEX g_v_tabix.
CHECK sy-subrc = 0.
s_fldnam-low = g_t_appl-fieldname.
s_fldnam-sign = 'I'.
s_fldnam-option = 'EQ'.
APPEND s_fldnam.
ENDIF.
ENDIF.
Check for field name on selection screen
AT SELECTION-SCREEN ON s_fldnam.
IF NOT p_fldnam IS INITIAL.
Data fetch : Table Fields
SELECT SINGLE * FROM dd03l
WHERE tabname EQ p_segnam
AND fieldname IN s_fldnam.
IF sy-subrc NE 0.
MESSAGE e429(mo).
ENDIF.
ENDIF.
F4 help for fieldname
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fldnam.
DATA : l_rc LIKE sy-subrc.
Check segment name on selection screen is not empty
IF NOT p_segnam IS INITIAL.
F4 Help for fieldname
PERFORM get_f4help USING l_rc.
IF l_rc = 0.
Fill the selected field name
READ TABLE g_t_appl INDEX g_v_tabix.
CHECK sy-subrc = 0.
p_fldnam = g_t_appl-fieldname.
ENDIF.
ENDIF.
Check for field name on selection screen
AT SELECTION-SCREEN ON p_fldnam.
IF NOT p_fldnam IS INITIAL.
Data fetch : Table Fields
SELECT SINGLE * FROM dd03l
WHERE tabname EQ p_segnam
AND fieldname EQ p_fldnam.
IF sy-subrc NE 0.
MESSAGE e429(mo).
ENDIF.
ENDIF.
Check for field name on selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_fldval-low.
Check field name is an input on selection screen
IF NOT p_fldnam IS INITIAL.
Get the domain values as F4 help
PERFORM get_domain_value.
ENDIF.
*Check for Message type on selection screen
AT SELECTION-SCREEN ON s_mestyp.
IF NOT s_mestyp IS INITIAL.
Data fetch : Logical message types
SELECT COUNT( * ) FROM edmsg
WHERE msgtyp IN s_mestyp.
IF sy-subrc NE 0.
MESSAGE e429(mo).
ENDIF.
ENDIF.
*Check for Basic type on selection screen
AT SELECTION-SCREEN ON s_idoctp.
IF NOT s_idoctp IS INITIAL.
Data fetch : Basic types
SELECT COUNT( * ) FROM edbas
WHERE idoctyp IN s_idoctp.
IF sy-subrc NE 0.
MESSAGE e429(mo).
ENDIF.
ENDIF.
*& Form GET_F4HELP
text
-->P_L_RC text
FORM get_f4help USING p_l_rc LIKE sy-subrc.
DATA : l_v_segment LIKE edsappl-segtyp.
DATA : l_t_help_value LIKE help_value OCCURS 0 WITH HEADER LINE.
Segment name
l_v_segment = p_segnam.
Data fetch : EDI: IDoc Segment Application Structure
SELECT pos fieldname FROM edsappl
INTO CORRESPONDING FIELDS OF TABLE g_t_appl
WHERE segtyp = l_v_segment
ORDER BY pos.
Popup having data
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 110
endpos_row = 16
startpos_col = 90
startpos_row = 1
titletext = text-001
IMPORTING
choise = g_v_tabix
TABLES
valuetab = g_t_appl
EXCEPTIONS
break_off = 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.
Return code
p_l_rc = sy-subrc.
ENDFORM. " GET_F4HELP
*& Form GET_DOMAIN_VALUE
text
-->P_L_RC text
FORM get_domain_value.
DD: Domain header with text
DATA : l_s_dd01v LIKE dd01v.
Value table
DATA : l_v_valuetab LIKE l_s_dd01v-entitytab.
RFC Table Read: Description of Fields to Retrieve
DATA : l_t_db_fld LIKE rfc_db_fld OCCURS 0 WITH HEADER LINE.
RFC Table Read: Select Options / WHERE Clause
DATA : l_t_options LIKE rfc_db_opt OCCURS 0 WITH HEADER LINE.
Table with a 512 byte field
DATA : l_t_valuetab LIKE tab512 OCCURS 0 WITH HEADER LINE.
*Data Dictionary access routines
CALL FUNCTION 'G_DOMAIN_READ'
EXPORTING
domain = p_fldnam
langu = sy-langu
IMPORTING
domain_attr = l_s_dd01v
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
l_v_valuetab = l_s_dd01v-entitytab.
l_t_db_fld-fieldname = p_fldnam.
APPEND l_t_db_fld.
External access to R/3 tables via RFC
CALL FUNCTION 'RFC_READ_TABLE'
EXPORTING
query_table = l_v_valuetab
DELIMITER = ' '
NO_DATA = ' '
ROWSKIPS = 0
ROWCOUNT = 0
TABLES
options = l_t_options
fields = l_t_db_fld
data = l_t_valuetab
EXCEPTIONS
table_not_available = 1
table_without_data = 2
option_not_valid = 3
field_not_valid = 4
not_authorized = 5
data_buffer_exceeded = 6
OTHERS = 7
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 g_v_tabix.
IF NOT l_t_valuetab[] IS INITIAL.
Popup having data
CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
EXPORTING
endpos_col = 110
endpos_row = 16
startpos_col = 90
startpos_row = 1
titletext = text-001
IMPORTING
choise = g_v_tabix
TABLES
valuetab = l_t_valuetab
EXCEPTIONS
break_off = 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.
READ TABLE l_t_valuetab INDEX g_v_tabix.
CHECK sy-subrc = 0.
Fill the select-options of Fieldvalue
s_fldval-low = l_t_valuetab-wa.
s_fldval-sign = 'I'.
s_fldval-option = 'EQ'.
APPEND s_fldval.
ENDIF.
ENDFORM. " GET_DOMAIN_VALUE
INCLUDE Y16S_VIEW_IDOC_CONTENT_F01I *
*& Module STATUS_0100 OUTPUT
ALV grid output
MODULE status_0100 OUTPUT.
*set the screen elements
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'TITLE100'.
*instantiation
IF g_custom_container IS INITIAL.
g_v_layout-zebra = 'X'.
g_v_layout-sel_mode = 'A'.
Create custom container
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
Create ALV grid
CREATE OBJECT grid1
EXPORTING i_parent = g_custom_container.
CREATE OBJECT g_v_recv EXPORTING grid_name = grid1.
Display ALV grid
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_save = g_c_save
is_layout = g_v_layout
is_print = g_f_print
is_variant = g_f_variant
CHANGING
it_fieldcatalog = g_t_fieldcat
it_outtab = refresh_table_display.
ENDIF.
User command
SET HANDLER g_v_recv->handle_user_command FOR grid1.
CALL METHOD grid1->set_toolbar_interactive.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
User actions on grid
MODULE user_command_0100 INPUT.
Dispatch the okcode
CALL METHOD cl_gui_cfw=>dispatch.
CASE g_f_okcode.
WHEN g_c_exit.
PERFORM exit_program.
WHEN OTHERS.
*do nothing
ENDCASE.
CLEAR g_f_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form EXIT_PROGRAM
Exit from the Grid
--> p1 text
<-- p2 text
FORM exit_program.
Container for Custom Controls in the Screen Area
CALL METHOD g_custom_container->free.
*Control Framework Basic Class
CALL METHOD cl_gui_cfw=>flush.
Call the selection screen
SET SCREEN 0.
LEAVE SCREEN.
ENDFORM. " EXIT_PROGRAM
*& Form GET_FCAT
Field catalog fill
--> p1 text
<-- p2 text
FORM get_fcat.
*Segment details regarding fields
PERFORM get_segment_details.
Populate the Fieldcatalog
PERFORM fill_fieldcat.
IF g_f_variant-variant IS INITIAL.
Get the default variant
g_f_repid = sy-repid.
CLEAR : g_f_variant.
g_f_variant-report = g_f_repid.
g_r_x_variant = g_f_variant.
Get default variant
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = g_c_save
CHANGING
cs_variant = g_r_x_variant
EXCEPTIONS
not_found = 2.
g_f_variant = g_r_x_variant.
g_f_variant-variant = 'X'.
ENDIF.
ENDFORM. " GET_FCAT
*& Form FILL_DATA
Fill the output internal table
--> p1 text
<-- p2 text
FORM fill_data.
FIELD-SYMBOLS TYPE ANY.
DATA : l_rc LIKE sy-subrc.
*Get the IDoc data
PERFORM get_data.
LOOP AT g_t_edid.
*Check for filtering the values
IF ( NOT ( p_fldnam IS INITIAL AND s_fldval[] IS INITIAL ) ).
Field value check
PERFORM check_fieldvalue USING l_rc.
IF l_rc NE 0.
CONTINUE.
ENDIF.
ENDIF.
ASSIGN LOCAL COPY OF g_t_edid TO .
ENDLOOP.
ENDFORM. " FILL_DATA
*& Form DISPLAY_GRID
Display ALV grid
--> p1 text
<-- p2 text
FORM display_grid.
Call ALV grid
CALL SCREEN 100.
ENDFORM. " DISPLAY_GRID
*& Form CHECK_FIELDVALUE
Check the fieldvalue
-->P_L_RC text
FORM check_fieldvalue USING p_l_rc LIKE sy-subrc.
Segment data
ASSIGN g_t_edid-sdata TO CASTING TYPE (p_segnam).
Segment fields
LOOP AT g_t_segment WHERE fieldname = p_fldnam.
ASSIGN COMPONENT g_t_segment-fieldname
OF STRUCTURE IN s_fldval.
p_l_rc = 0.
ELSE.
p_l_rc = 4.
ENDIF.
ENDLOOP.
ENDFORM. " CHECK_FIELDVALUE
*& Form GET_DATA
Get the IDoc data
--> p1 text
<-- p2 text
FORM get_data.
*Clear the header line of the internal table
CLEAR : g_t_edid,
g_t_edidc.
Clear the body of the internal table
REFRESH : g_t_edid,
g_t_edidc.
*Data fetch : Control record (IDoc)
SELECT docnum credat mestyp FROM edidc
INTO TABLE g_t_edidc
WHERE docnum IN s_idocnm AND
credat IN s_date AND
mestyp IN s_mestyp AND
idoctp IN s_idoctp.
*Date/Message type if not initial
IF ( ( NOT ( s_date[] IS INITIAL ) )
OR ( NOT ( s_mestyp[] IS INITIAL ) )
OR ( NOT ( s_idoctp[] IS INITIAL ) ) ).
Check the control record of the IDoc
PERFORM check_control_data.
ELSE.
Data fetch : IDoc Data Records from 4.0 onwards
SELECT docnum segnum sdata FROM edid4 INTO TABLE g_t_edid
WHERE docnum IN s_idocnm AND
segnam EQ p_segnam.
ENDIF.
ENDFORM. " GET_DATA
*& Form CHECK_CONTROL_DATA
Check the control data of IDoc
--> p1 text
<-- p2 text
FORM check_control_data.
CHECK NOT g_t_edidc[] IS INITIAL.
Data fetch : IDoc Data Records from 4.0 onwards
SELECT docnum segnum sdata FROM edid4 INTO TABLE g_t_edid
WHERE docnum IN s_idocnm AND
segnam EQ p_segnam.
LOOP AT g_t_edid.
READ TABLE g_t_edidc WITH KEY docnum = g_t_edid-docnum.
*Check for the correct MT
IF sy-subrc = 0.
CONTINUE.
ELSE.
*Delete, if unsuccessful
DELETE g_t_edid.
ENDIF.
ENDLOOP.
ENDFORM. " CHECK_CONTROL_DATA
*& Form GET_SEGMENT_DETAILS
Segment details regarding fields
--> p1 text
<-- p2 text
FORM get_segment_details.
Segment name
g_f_segment = p_segnam.
CALL FUNCTION 'NAMETAB_GET'
EXPORTING
langu = sy-langu
tabname = g_f_segment
TABLES
nametab = g_t_segment
EXCEPTIONS
internal_error = 1
table_has_no_fields = 2
table_not_activ = 3
no_texts_found = 4
OTHERS = 5.
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. " GET_SEGMENT_DETAILS
*& Form FILL_FIELDCAT
Populate the Fieldcatalog
--> p1 text
<-- p2 text
FORM fill_fieldcat.
DATA : lv_pos TYPE i.
IDoc number in the catalog
lv_pos = 1.
g_r_fieldcat-fieldname = 'DOCNUM'.
g_r_fieldcat-ref_table = 'EDID4'.
g_r_fieldcat-ref_field = 'DOCNUM'.
g_r_fieldcat-key = 'X'.
g_r_fieldcat-col_pos = lv_pos.
g_r_fieldcat-outputlen = '10'.
APPEND g_r_fieldcat TO g_t_fieldcat.
Segment number in the catalog
ADD 1 TO lv_pos.
g_r_fieldcat-fieldname = 'SEGNUM'.
g_r_fieldcat-ref_table = 'EDID4'.
g_r_fieldcat-ref_field = 'SEGNUM'.
g_r_fieldcat-key = 'X'.
g_r_fieldcat-col_pos = lv_pos.
g_r_fieldcat-outputlen = '10'.
g_r_fieldcat-colddictxt = 'X'.
g_r_fieldcat-reptext = text-002.
APPEND g_r_fieldcat TO g_t_fieldcat.
**Populating fieldcatalog with segment field
LOOP AT g_t_segment .
ADD 1 TO lv_pos.
CLEAR g_r_fieldcat.
g_r_fieldcat-fieldname = g_t_segment-fieldname .
g_r_fieldcat-ref_table = p_segnam.
g_r_fieldcat-ref_field = g_t_segment-fieldname .
g_r_fieldcat-key = 'X'.
g_r_fieldcat-col_pos = lv_pos.
g_r_fieldcat-outputlen = '10'.
Check for given fields on the selection screen
IF NOT g_t_segment-fieldname IN s_fldnam.
g_r_fieldcat-no_out = 'X'.
ENDIF.
*Column text
IF g_t_segment-fieldtext IS INITIAL.
*Get the DDIC texts for columns
PERFORM get_ddic_texts.
ENDIF.
APPEND g_r_fieldcat TO g_t_fieldcat.
ENDLOOP.
ENDFORM. " FILL_FIELDCAT
*& Form GET_DDIC_TEXTS
Get the DDIC texts
--> p1 text
<-- p2 text
FORM get_ddic_texts.
DATA : l_f_descr TYPE string.
Get the texts for the data element
CALL FUNCTION 'TB_DATAELEMENT_GET_TEXTS'
EXPORTING
name = g_t_segment-fieldname
IMPORTING
description = l_f_descr
LENGTH_FIELD =
LENGTH_HEADER =
LENGTH_LONG =
LENGTH_MIDDLE =
LENGTH_SHORT =
TEXT_HEADER =
TEXT_LONG =
TEXT_MIDDLE =
TEXT_SHORT =
EXCEPTIONS
not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Add DDIC text..
g_r_fieldcat-colddictxt = 'X'.
g_r_fieldcat-reptext = l_f_descr.
ENDFORM. " GET_DDIC_TEXTS
Maybe you are looking for
-
I have multiple pie charts displayed on the same page. I would like to maintain consistent legend across all the graphs as below. 0 - 10 % - Red 11- 20% - Green 21 - 30% - Blue 31- 40% - Black 41-50% - Yellow some of the charts may not certain ranges
-
Itunes match, itunes radio and playlists...HELP!
okay. so i turn on itunes match on my phone so I dont listen to ads while listening to itunes radio. when i do that and connect it to my computer via usb, i cannot sync any smart playlists to my phone. they are all icloud available but i cant find th
-
Placing clients in untrusted after log off of AS SSO
I have a L3 OOB NAC deployment with AD SSO. Users are mapped to different roles depending on OU membership and then to different VLANs. What happens is that if a user with a certain role logs on to a client and is palced in his VLAN, say VLAN10, and
-
I am converting files containing psd images into pdfs using Acrobat 8. The images appear fuzzy in the pdfs. I know I sorted this out in Acrobat 6 but can't remember how and the help files are not very helpful. What should I do ?
-
Excel display problem on retina macbook pro
Just migrated excel files from macbook pro to retina macbook pro and now having trouble with excel - can't get to bottom RH corner of excel display in order to shrink to reasonable size any suggestions to solve this?